The clickLink implementation throws an exception in PHP 5.3 because the $url_target variable is not always defined.

If it isn't set, I'm not sure if it is best to leave it blank, or have some text or what. Here is a patch that makes it say 'Not Found' in place of the URL in the assertion.

Noticed over here: http://drupal.org/node/647964#comment-3918426 There are 3 exceptions in this test run because it is trying to click a link that apparently doesn't exist.

Comments

loganfsmyth’s picture

Status: Active » Needs review
StatusFileSize
new1 KB

Here's my patch.

naxoc’s picture

Version: 7.x-dev » 8.x-dev

This is still an issue in D8. The $url_target variable never gets set if there is something wrong with the link.

xjm’s picture

Issue tags: +Needs backport to D7

Tagging for backport.

xjm’s picture

Status: Needs review » Needs work

I think if the link is not found, there should probably be an assertion failure explicitly stating it was not found.

xjm’s picture

Issue tags: +Novice
kid_icarus’s picture

Status: Needs work » Needs review
StatusFileSize
new744 bytes

Is it still considered backporting if you go from 7.x to 8.x?

As far as a test goes, I was working on one over at #1452896: PHP notice in clickLink if link does not exist but I was having trouble with the logic. I'll give it another shot but, perhaps this patch will give me more to work with :)

freblasty’s picture

Assigned: Unassigned » freblasty

Picking this up for the office hours sprint.

freblasty’s picture

StatusFileSize
new1.13 KB

When the assertion fails it will explicitly state that the link was not found instead of the $url_target being set to 'Not found'.

webchick’s picture

Status: Needs review » Closed (duplicate)

#1452896: PHP notice in clickLink if link does not exist is technically a duplicate of this one, but it has a bit more discussion + an automated test, so unfortunately I'm closing this one. So sorry! Please feel free to head over there if you're keen to continue working on this. :)