undefined index notice

snufkin - April 17, 2008 - 19:55
Project:FeedAPI
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

I was testing feedapi on -r DRUPAL-6, and got these notices:

notice: Undefined index: type in /home/balu/projects/drupal/6/planetsoc/sites/all/modules/feedapi/feedapi.module on line 474.

Even more weird error jumps up when I hit node/add/feedapi-node:

* notice: Undefined index: type in /home/balu/projects/drupal/6/planetsoc/sites/all/modules/feedapi/feedapi.module on line 474.
* notice: Undefined property: stdClass::$feedapi_node in /home/balu/projects/drupal/6/planetsoc/sites/all/modules/feedapi/feedapi_inherit/feedapi_inherit.module on line 33.
* notice: Trying to get property of non-object in /home/balu/projects/drupal/6/planetsoc/sites/all/modules/feedapi/feedapi_inherit/feedapi_inherit.module on line 33.
* notice: Undefined index: values in /home/balu/projects/drupal/6/planetsoc/sites/all/modules/feedapi/feedapi.module on line 486.
* notice: Undefined property: stdClass::$feed in /home/balu/projects/drupal/6/planetsoc/sites/all/modules/feedapi/feedapi.module on line 489.
* notice: Trying to get property of non-object in /home/balu/projects/drupal/6/planetsoc/sites/all/modules/feedapi/feedapi.module on line 489.
* notice: Undefined index: values in /home/balu/projects/drupal/6/planetsoc/sites/all/modules/feedapi/feedapi.module on line 492.
* notice: Undefined variable: feedapi_url_default in /home/balu/projects/drupal/6/planetsoc/sites/all/modules/feedapi/feedapi.module on line 499.
* notice: Undefined variable: form in /home/balu/projects/drupal/6/planetsoc/sites/all/modules/feedapi/feedapi_inherit/feedapi_inherit.module on line 77.
* notice: Undefined variable: form in /home/balu/projects/drupal/6/planetsoc/sites/all/modules/feedapi/feedapi_node/feedapi_node.module on line 147.
* notice: Undefined index: parser_common_syndication in /home/balu/projects/drupal/6/planetsoc/sites/all/modules/feedapi/feedapi.module on line 519.
* notice: Undefined property: stdClass::$nid in /home/balu/projects/drupal/6/planetsoc/sites/all/modules/feedapi/feedapi.module on line 543.

#1

mustafau - April 18, 2008 - 17:11
Version:6.x-1.2» 6.x-1.x-dev
Status:active» patch (code needs review)

I have created a patch to fix these error.

AttachmentSize
feedapi-undefined_index_fixes.patch4.5 KB

#2

webchick - April 20, 2008 - 06:08

I still get:

    * notice: Undefined property: stdClass::$modified in /var/www/planetsoc/drupal5/modules/node/node.module on line 499.
    * notice: Undefined property: stdClass::$locked in /var/www/planetsoc/drupal5/modules/node/node.module on line 499.
    * notice: Undefined property: stdClass::$orig_type in /var/www/planetsoc/drupal5/modules/node/node.module on line 499.

...when first installing the FeedAPI Node module.

This patch is the same as above, but also fixes these notices.

AttachmentSize
feedapi-fix-notices-248042-2.patch6.01 KB

#3

webchick - April 20, 2008 - 06:20
Status:patch (code needs review)» patch (code needs work)

Ugh. No, there are still a bunch...

On fresh node creation:

Undefined property: stdClass::$nid in /var/www/planetsoc/drupal5/sites/all/modules/feedapi/feedapi.module on line 544.

after you fix that one:

Undefined variable: settings in /var/www/planetsoc/drupal5/sites/all/modules/feedapi/feedapi.module on line 547.

after you fix that one:

    * notice: Undefined index: refresh_on_create in /var/www/planetsoc/drupal5/sites/all/modules/feedapi/feedapi.module on line 1345.
    * notice: Undefined index: update_existing in /var/www/planetsoc/drupal5/sites/all/modules/feedapi/feedapi.module on line 1345.
    * notice: Undefined index: skip in /var/www/planetsoc/drupal5/sites/all/modules/feedapi/feedapi.module on line 1345.
    * notice: Undefined index: items_delete in /var/www/planetsoc/drupal5/sites/all/modules/feedapi/feedapi.module on line 1345.
    * notice: Undefined index: processors in /var/www/planetsoc/drupal5/sites/all/modules/feedapi/feedapi.module on line 1349.

:(

This is going to take too much time for me to look into atm.

#4

mustafau - April 21, 2008 - 17:30
Status:patch (code needs work)» patch (code needs review)

This patch seems to fix all of those notices.

AttachmentSize
feedapi-fix-notices.patch6.27 KB

#5

mustafau - April 22, 2008 - 08:50
Status:patch (code needs review)» patch (code needs work)

Following notices are remaining:

* notice: Undefined index: #validate in feedapi.module on line 1351.
* notice: Undefined index: defaults in feedapi.module on line 1351.
* notice: Undefined index: refresh_on_create in feedapi.module on line 1347.
* notice: Undefined index: update_existing in feedapi.module on line 1347.
* notice: Undefined index: skip in feedapi.module on line 1347.
* notice: Undefined index: defaults in feedapi.module on line 1351.
* notice: Undefined index: x_dedupe in feedapi.module on line 1347.

#6

mustafau - April 23, 2008 - 18:17

Following notices are shown on non FeedAPI-enabled node form. Updated patch fixing these notices is attached.

    * notice: Undefined property: stdClass::$feedapi_node in feedapi_node\feedapi_node.module on line 39.
    * notice: Trying to get property of non-object in feedapi_node\feedapi_node.module on line 39.
    * notice: Undefined property: stdClass::$feedapi_node in feedapi_node\feedapi_node.module on line 33.
    * notice: Undefined property: stdClass::$feedapi_node in feedapi_node\feedapi_node.module on line 83.

AttachmentSize
feedapi-fix-notices.patch8.12 KB

#7

mustafau - April 25, 2008 - 16:48

I found following notices:

    * notice: Undefined property: stdClass::$headers in parser_common_syndication\parser_common_syndication.module on line 165.
    * notice: Undefined property: stdClass::$data in parser_common_syndication\parser_common_syndication.module on line 172.
    * notice: Undefined property: stdClass::$headers in parser_common_syndication\parser_common_syndication.module on line 168.
    * notice: Trying to get property of non-object in parser_common_syndication\parser_common_syndication.module on line 65.
    * notice: Trying to get property of non-object in feedapi.module on line 1265.
    * notice: Undefined property: stdClass::$title in feedapi.module on line 563.
    * notice: Undefined property: stdClass::$description in feedapi.module on line 567.

Updated patch fixing all but following is attached.

    * notice: Trying to get property of non-object in feedapi.module on line 1265.
    * notice: Undefined property: stdClass::$title in feedapi.module on line 563.
    * notice: Undefined property: stdClass::$description in feedapi.module on line 567.

AttachmentSize
feedapi-fix-notices.patch15.89 KB

#8

Aron Novak - April 28, 2008 - 20:21

Thanks a lot to all of you to providing the patches! (while i was struggling at the university, FeedAPI become better continuously :D )
But I'm curious why these messages appear. I have never seen those messages and even more important:
http://php.net/manual/en/function.error-reporting.php

// Report all errors except E_NOTICE
// This is the default value set in php.ini
error_reporting(E_ALL ^ E_NOTICE);

So by default, notices are not displayed. Do all of you use non-default value? Is there such a module which alters this default behavior?

#9

webchick - April 28, 2008 - 21:35

^ E_NOTICE is only added for releases of Drupal. Dev tarballs and CVS checkouts (-r DRUPAL-6) report E_ALL.

#10

Aron Novak - April 28, 2008 - 21:40
Status:patch (code needs work)» fixed

Ahha, i always use official releases. This explains everything. :)
Anyway, the patch is fixed and i also killed some possible notice-source.

Please reopen if a notice appears and give the number of the line and the revision of the code.

#11

mustafau - April 29, 2008 - 13:13
Status:fixed» active

Following notices are remaining:

# notice: Undefined property: stdClass::$nid in feedapi.module on line 977.
# notice: Undefined property: stdClass::$code in parser_common_syndication\parser_common_syndication.module on line 152.
# notice: Undefined property: stdClass::$headers in parser_common_syndication\parser_common_syndication.module on line 171.
# notice: Trying to get property of non-object in parser_common_syndication\parser_common_syndication.module on line 65.

#12

mustafau - April 29, 2008 - 13:32

More notices:

    * notice: Undefined index: #validate in feedapi.module on line 1352.
    * notice: Undefined index: defaults in feedapi.module on line 1352.
    * notice: Undefined index: nid in feedapi.module on line 1034.

#13

mustafau - April 29, 2008 - 13:41

Following notice is shown when there is no entry in the stats table:

notice: Undefined variable: stat in feedapi.module on line 1523.

Fix is attached.

AttachmentSize
feedapi_stat.patch691 bytes

#14

mustafau - April 29, 2008 - 13:52

Even more:

notice: Undefined property: stdClass::$feed in feedapi.module on line 222.
notice: Undefined variable: between in feedapi.module on line 1367.

#15

Aron Novak - April 29, 2008 - 17:12
Status:active» fixed

I fixed all of the above notices.

#16

Anonymous (not verified) - May 13, 2008 - 17:13
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.