Attached are patches on HEAD and Drupal 6 for this watchdog error generated by RSS feeds with file attachments: "Undefined index: value in includes/common.inc on line 962."

This could also be fixed by adding some isset() logic in common.inc -- it depends what is desired here, strictness or flexibility of the Drupal API.

Comments

mfb’s picture

Status: Active » Needs review
mfb’s picture

Version: 6.x-dev » 7.x-dev
Component: upload.module » base system
StatusFileSize
new783 bytes

This alternate patch seems better now that I look at it, as format_xml_elements() already has similar isset() logic for attributes.

dries’s picture

Version: 7.x-dev » 6.x-dev
Status: Needs review » Needs work

I've committed this to CVS HEAD.

I tried committing it to DRUPAL-6 but it failed to apply. I'm changing the version to 6.x and marking it 'code needs work' so it can be re-rolled.

Keep up the great work, mfb!

mfb’s picture

Status: Needs work » Reviewed & tested by the community
StatusFileSize
new741 bytes
stevenpatz’s picture

Status: Reviewed & tested by the community » Needs review
mfb’s picture

StatusFileSize
new742 bytes

Reroll to get rid of (offset 10 lines) warning.

webchick’s picture

Status: Needs review » Reviewed & tested by the community

Confirmed this fixes the error in both rss.xml and taxonomy/term/blah/feed.

RTBC!

gábor hojtsy’s picture

Status: Reviewed & tested by the community » Needs work

Why not use !empty()?

webchick’s picture

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

Well, great question! :D

Marking back up to 7.x-dev to fix there and then backport.

mfb’s picture

Version: 7.x-dev » 6.x-dev
Status: Needs work » Needs review

Because a value of 0 (which would be "empty") should still be printed?

mfb’s picture

Version: 6.x-dev » 7.x-dev
Status: Needs review » Needs work

Actually, would it just ignore 0 because that would evaluate as ''?

mfb’s picture

Version: 7.x-dev » 6.x-dev
Status: Needs work » Needs review

OK the difference would actually be for '0' not 0. We probably do not want to ignore a string value of '0'? At least, we haven't been so far.

dman’s picture

Status: Needs review » Reviewed & tested by the community

How come this never made it back into DRUPAL-6?

gábor hojtsy’s picture

Status: Reviewed & tested by the community » Fixed

@dman: because as you can see above, it was still discussed.

I get that '0' should be allowed as a value, so this is indeed better. I'm not entirely fond of this not documented in the code (ie. someone could come around and 'simplify' this code, just like I suggested), but I've committed it as-is anyway.

dman’s picture

Cool then, thanks! It looked to me like the fix was good enough to be put into Drupal 7 over a year ago but just stalled waiting to be backported to 6 :-) . So it needed a nudge ;-)

It just bit me this week, is all ( I saw it last year too, and did this patch by hand on that version) .
I've got E_ALL notices on, and some semantic browser plugin (I suspect) was pinging my rss every pageview (I have no idea what's up with that) and showing the notices all the time. Normally I'm guessing that RSS-triggered notices fade away into /dev/null, which is why nobody has noticed the bug was still there..
Triggered by upload.module and image_attach.module both.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.