There's a trivial bug in 'form.inc'. I'm attaching a patch.

When reporting some error via watchdog(), an error message is composed, but a varible used in it, $v, is undefined. It should be $elements['#value'] instead (by examining a few lines preceding that erroneous line you can easily see how that "$v" got here: the programmer just copied verbatim a previous line).

I found this bug while trying to help a user who complained about this error message being printed. Since a wrong variable is sent to watchdog(), this error message doesn't contain enough information, and we can't help the user... :-(

Comments

dries’s picture

I think this fixed a bug indeed. :)

However, this doesn't look quite right:

... theme_placeholder(check_plain($elements['#value'])) ...

Shouldn't that be the following:

... theme('placeholder', $elements['#value']) ...
amnon’s picture

Shouldn't that be the following:

... theme('placeholder', $elements['#value']) ...

Yes, you're right. It should be theme('placeholder'...)

There are two occurrences of "theme_placeholder" in this file -- for no reason, it seems, because they are followed by theme('placeholder',...) on the same line...

dries’s picture

Status: Needs review » Needs work

Alright, moving this to 'code needs work' status.

rblomme@drupal.org’s picture

Version: 4.7.2 » 4.7.3
StatusFileSize
new1.04 KB

the patch file for cvs DRUPAL-4.7 branch in attachment

edmund.kwok’s picture

Version: 4.7.3 » 4.7.4
Status: Needs work » Needs review
StatusFileSize
new1.82 KB

Rerolled patch for 4.7.4. Also changed another theme_placeholder to use theme('placeholder') instead.

killes@www.drop.org’s picture

Version: 4.7.4 » 5.x-dev

applied to 4.7, please check for D5.

dries’s picture

Status: Needs review » Fixed

This is fixed in D5. Thanks all!

Anonymous’s picture

Status: Fixed » Closed (fixed)