I've been doing some devious things with defining sources so I'm not sure if these are normal notices but I've been getting them for each item imported.

Notice: Undefined index: querypathparser:2 in FeedsProcessor->map() (line 133 of /var/www/feeds_test/sites/all/modules/feeds-DRUPAL-6--1/plugins/FeedsProcessor.inc).

Notice: Undefined variable: convert_to_array in FeedsProcessor->map() (line 116 of /var/www/feeds_test/sites/all/modules/feeds-DRUPAL-6--1/plugins/FeedsProcessor.inc).

I've also been getting on each update:

Notice: Undefined index: clearing in FeedsBatch->getTotal() (line 36 of /var/www/feeds_test/sites/all/modules/feeds-DRUPAL-6--1/includes/FeedsBatch.inc).

CommentFileSizeAuthor
feeds_notices.patch2.52 KBtwistor

Comments

twistor’s picture

Status: Active » Needs review
milesw’s picture

Was getting the same notices with beta9. The patch applied cleanly and resolved all notices.

marcvangend’s picture

Priority: Minor » Normal
Status: Needs review » Reviewed & tested by the community

Same here. Patch applies to beta 9 and solves all 'Undefined variable' and 'Undefined index' notices.

PS. I don't think this is minor because the large number of messages renders /admin/reports/dblog unusable.

markabur’s picture

Nice, patch gets rid of a bunch of similar errors for me too.

David Goode’s picture

Status: Reviewed & tested by the community » Needs work

I haven't thoroughly reviewed the patch or its ramifications, but just looking at it:
1) It creates a variable it never uses.
2) Calling isset && is_array is redundant; just call is_array().
3) Branching on isset and returning NULL otherwise doesn't do anything; it would return NULL already, because that is how isset would return FALSE in the first place. I don't think that change to getTotal() actually does anything different.
4) Would it be better to cast a non-null value to an array instead of ignoring it? Test to see what problems this causes and what situations might result in a non-NULL but non-array argument to these functions. Is it an example of improper input to this function that should be patched and resolved elsewhere?

twistor’s picture

@David,
1. Not sure what you are referring to.
2. They accomplish the same thing yes, but calling is_array on a variable that's not set throws a notice as well.
3. See ablove.
4. I agree. These are all probably improper input. I'll look into it when I have time.

In order to see the notices you must have E_NOTICE turned on.

danepowell’s picture

I'm having a similar problem, do you think it's related? My module is failing automated tests because of this... #1087622: Notice: Undefined index: processing in FeedsBatch->getTotal()

If this is related, is there some sort of workaround to get tests working again?

danepowell’s picture

Nevermind, I'm fairly sure that my problem is due to #1344316: Use recommended release rather than just sorting and thus using 6.x-1.0-beta9 instead of 6.x-1.0-beta11

twistor’s picture

Status: Needs work » Closed (duplicate)