Get error on node save. Error appeared only once per node.
Insert / update nodes with module "Feed import";

Notice: Trying to get property of non-object in _taxonomy_menu_nodeapi_helper() (line 487 of /var/www/new_harbinger/sites/all/modules/contrib/taxonomy_menu/taxonomy_menu.module).
Warning: array_flip(): Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->load() (line 178 of /var/www/new_harbinger/includes/entity.inc).
Warning: array_flip(): Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->cacheGet() (line 354 of /var/www/new_harbinger/includes/entity.inc).
Notice: Trying to get property of non-object in _taxonomy_menu_nodeapi_helper() (line 488 of /var/www/new_harbinger/sites/all/modules/contrib/taxonomy_menu/taxonomy_menu.module).
Warning: array_flip(): Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->load() (line 178 of /var/www/new_harbinger/includes/entity.inc).
Warning: array_flip(): Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->cacheGet() (line 354 of /var/www/new_harbinger/includes/entity.inc).
Notice: Trying to get property of non-object in _taxonomy_menu_nodeapi_helper() (line 489 of /var/www/new_harbinger/sites/all/modules/contrib/taxonomy_menu/taxonomy_menu.module).
Warning: array_flip(): Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->load() (line 178 of /var/www/new_harbinger/includes/entity.inc).
Warning: array_flip(): Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->cacheGet() (line 354 of /var/www/new_harbinger/includes/entity.inc).
Notice: Trying to get property of non-object in _taxonomy_menu_nodeapi_helper() (line 490 of /var/www/new_harbinger/sites/all/modules/contrib/taxonomy_menu/taxonomy_menu.module).
Warning: array_flip(): Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->load() (line 178 of /var/www/new_harbinger/includes/entity.inc).
Warning: array_flip(): Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->cacheGet() (line 354 of /var/www/new_harbinger/includes/entity.inc).

Comments

sergiu.savva’s picture

StatusFileSize
new603 bytes

this works for me

-    $term = taxonomy_term_load($tid);
+    if (!$term = taxonomy_term_load($tid)) {
+      continue;
+    }
hles’s picture

Status: Active » Needs review
sergiu.savva’s picture

StatusFileSize
new740 bytes

added some comments

   foreach ($terms as $key => $tid) {
-    $term = taxonomy_term_load($tid);
+
+    // taxonomy_term_load($tid) return FALSE if the term was not found
+    // if taxonomy $term is false, then go to the next $term
+    if (!$term = taxonomy_term_load($tid)) {
+      continue;
+    }
hles’s picture

Do you have information on why it would return FALSE in the first place ? Maybe if the term should not be processed (depending on the answer of the question before), it should not done silently.

sergiu.savva’s picture

If the term has been removed and term_id remain in the node when we call taxonomy_term_load($tid) function returns FALSE

hles’s picture

Priority: Normal » Minor

FYI this fix is already part of 7.x-2.x branch.

sergiu.savva’s picture

thx
in anticipation of the new release

jenlampton’s picture

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

Saving a node on my site currently generates about 24 warnings and 24 notices (48 error messages) because of this bug. It's certainly not minor, but I'm glad that it's already been fixed in the next release. Can't wait to upgrade :)

It can be replicated by adding a taxonomy term reference field to a node where terms in that vocabulary are in the taxonomy menu. The field type should be checkboxes, and the errors will appear when the checkboxes are left unchecked. Two for each empty checkbox.

This patch prevents these errors on my pages when nodes are saved :) Thank you @sergiu.savva

deanflory’s picture

After updating to Drupal 7.22 yesterday, I'm now getting these errors (and a lot more from other modules). This module's project page states the 2.x version is not ready for production yet but this issue states the fix for this is in the 2.x version. Should I use v2.x?

Here's the errors I'm getting that include the original poster's error plus a few more that may be related:

• Notice: Trying to get property of non-object in _taxonomy_menu_nodeapi_helper() (line 487 of /.../sites/all/modules/taxonomy_menu/taxonomy_menu.module).
• Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->load() (line 178 of /.../includes/entity.inc).
• Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->cacheGet() (line 355 of /.../includes/entity.inc).
• Notice: Trying to get property of non-object in _taxonomy_menu_nodeapi_helper() (line 488 of /.../sites/all/modules/taxonomy_menu/taxonomy_menu.module).
• Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->load() (line 178 of /.../includes/entity.inc).
• Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->cacheGet() (line 355 of /.../includes/entity.inc).
• Notice: Trying to get property of non-object in _taxonomy_menu_nodeapi_helper() (line 489 of /.../sites/all/modules/taxonomy_menu/taxonomy_menu.module).
• Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->load() (line 178 of /.../includes/entity.inc).
• Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->cacheGet() (line 355 of /.../includes/entity.inc).
• Notice: Trying to get property of non-object in _taxonomy_menu_nodeapi_helper() (line 490 of /.../sites/all/modules/taxonomy_menu/taxonomy_menu.module).
• Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->load() (line 178 of /.../includes/entity.inc).
• Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->cacheGet() (line 355 of /.../includes/entity.inc).
• Notice: Trying to get property of non-object in _taxonomy_menu_nodeapi_helper() (line 487 of /.../sites/all/modules/taxonomy_menu/taxonomy_menu.module).
• Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->load() (line 178 of /.../includes/entity.inc).
• Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->cacheGet() (line 355 of /.../includes/entity.inc).
• Notice: Trying to get property of non-object in _taxonomy_menu_nodeapi_helper() (line 488 of /.../sites/all/modules/taxonomy_menu/taxonomy_menu.module).
• Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->load() (line 178 of /.../includes/entity.inc).
• Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->cacheGet() (line 355 of /.../includes/entity.inc).
• Notice: Trying to get property of non-object in _taxonomy_menu_nodeapi_helper() (line 489 of /.../sites/all/modules/taxonomy_menu/taxonomy_menu.module).
• Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->load() (line 178 of /.../includes/entity.inc).
• Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->cacheGet() (line 355 of /.../includes/entity.inc).
• Notice: Trying to get property of non-object in _taxonomy_menu_nodeapi_helper() (line 490 of /.../sites/all/modules/taxonomy_menu/taxonomy_menu.module).
• Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->load() (line 178 of /.../includes/entity.inc).
• Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->cacheGet() (line 355 of /.../includes/entity.inc).
• Notice: Trying to get property of non-object in _taxonomy_menu_nodeapi_helper() (line 487 of /.../sites/all/modules/taxonomy_menu/taxonomy_menu.module).
• Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->load() (line 178 of /.../includes/entity.inc).
• Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->cacheGet() (line 355 of /.../includes/entity.inc).
• Notice: Trying to get property of non-object in _taxonomy_menu_nodeapi_helper() (line 488 of /.../sites/all/modules/taxonomy_menu/taxonomy_menu.module).
• Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->load() (line 178 of /.../includes/entity.inc).
• Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->cacheGet() (line 355 of /.../includes/entity.inc).
• Notice: Trying to get property of non-object in _taxonomy_menu_nodeapi_helper() (line 489 of /.../sites/all/modules/taxonomy_menu/taxonomy_menu.module).
• Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->load() (line 178 of /.../includes/entity.inc).
• Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->cacheGet() (line 355 of /.../includes/entity.inc).
• Notice: Trying to get property of non-object in _taxonomy_menu_nodeapi_helper() (line 490 of /.../sites/all/modules/taxonomy_menu/taxonomy_menu.module).
• Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->load() (line 178 of /.../includes/entity.inc).
• Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->cacheGet() (line 355 of /.../includes/entity.inc).
• Notice: Trying to get property of non-object in _taxonomy_menu_nodeapi_helper() (line 487 of /.../sites/all/modules/taxonomy_menu/taxonomy_menu.module).
• Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->load() (line 178 of /.../includes/entity.inc).
• Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->cacheGet() (line 355 of /.../includes/entity.inc).
• Notice: Trying to get property of non-object in _taxonomy_menu_nodeapi_helper() (line 488 of /.../sites/all/modules/taxonomy_menu/taxonomy_menu.module).
• Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->load() (line 178 of /.../includes/entity.inc).
• Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->cacheGet() (line 355 of /.../includes/entity.inc).
• Notice: Trying to get property of non-object in _taxonomy_menu_nodeapi_helper() (line 489 of /.../sites/all/modules/taxonomy_menu/taxonomy_menu.module).
• Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->load() (line 178 of /.../includes/entity.inc).
• Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->cacheGet() (line 355 of /.../includes/entity.inc).
• Notice: Trying to get property of non-object in _taxonomy_menu_nodeapi_helper() (line 490 of /.../sites/all/modules/taxonomy_menu/taxonomy_menu.module).
• Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->load() (line 178 of /.../includes/entity.inc).
• Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->cacheGet() (line 355 of /.../includes/entity.inc).
• Notice: Trying to get property of non-object in _taxonomy_menu_nodeapi_helper() (line 487 of /.../sites/all/modules/taxonomy_menu/taxonomy_menu.module).
• Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->load() (line 178 of /.../includes/entity.inc).
• Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->cacheGet() (line 355 of /.../includes/entity.inc).
• Notice: Trying to get property of non-object in _taxonomy_menu_nodeapi_helper() (line 488 of /.../sites/all/modules/taxonomy_menu/taxonomy_menu.module).
• Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->load() (line 178 of /.../includes/entity.inc).
• Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->cacheGet() (line 355 of /.../includes/entity.inc).
• Notice: Trying to get property of non-object in _taxonomy_menu_nodeapi_helper() (line 489 of /.../sites/all/modules/taxonomy_menu/taxonomy_menu.module).
• Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->load() (line 178 of /.../includes/entity.inc).
• Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->cacheGet() (line 355 of /.../includes/entity.inc).
• Notice: Trying to get property of non-object in _taxonomy_menu_nodeapi_helper() (line 490 of /.../sites/all/modules/taxonomy_menu/taxonomy_menu.module).
• Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->load() (line 178 of /.../includes/entity.inc).
• Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->cacheGet() (line 355 of /.../includes/entity.inc).
• Notice: Trying to get property of non-object in _taxonomy_menu_nodeapi_helper() (line 487 of /.../sites/all/modules/taxonomy_menu/taxonomy_menu.module).
• Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->load() (line 178 of /.../includes/entity.inc).
• Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->cacheGet() (line 355 of /.../includes/entity.inc).
• Notice: Trying to get property of non-object in _taxonomy_menu_nodeapi_helper() (line 488 of /.../sites/all/modules/taxonomy_menu/taxonomy_menu.module).
• Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->load() (line 178 of /.../includes/entity.inc).
• Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->cacheGet() (line 355 of /.../includes/entity.inc).
• Notice: Trying to get property of non-object in _taxonomy_menu_nodeapi_helper() (line 489 of /.../sites/all/modules/taxonomy_menu/taxonomy_menu.module).
• Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->load() (line 178 of /.../includes/entity.inc).
• Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->cacheGet() (line 355 of /.../includes/entity.inc).
• Notice: Trying to get property of non-object in _taxonomy_menu_nodeapi_helper() (line 490 of /.../sites/all/modules/taxonomy_menu/taxonomy_menu.module).
• Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->load() (line 178 of /.../includes/entity.inc).
• Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->cacheGet() (line 355 of /.../includes/entity.inc).
• Notice: Trying to get property of non-object in _taxonomy_menu_nodeapi_helper() (line 487 of /.../sites/all/modules/taxonomy_menu/taxonomy_menu.module).
• Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->load() (line 178 of /.../includes/entity.inc).
• Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->cacheGet() (line 355 of /.../includes/entity.inc).
• Notice: Trying to get property of non-object in _taxonomy_menu_nodeapi_helper() (line 488 of /.../sites/all/modules/taxonomy_menu/taxonomy_menu.module).
• Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->load() (line 178 of /.../includes/entity.inc).
• Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->cacheGet() (line 355 of /.../includes/entity.inc).
• Notice: Trying to get property of non-object in _taxonomy_menu_nodeapi_helper() (line 489 of /.../sites/all/modules/taxonomy_menu/taxonomy_menu.module).
• Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->load() (line 178 of /.../includes/entity.inc).
• Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->cacheGet() (line 355 of /.../includes/entity.inc).
• Notice: Trying to get property of non-object in _taxonomy_menu_nodeapi_helper() (line 490 of /.../sites/all/modules/taxonomy_menu/taxonomy_menu.module).
• Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->load() (line 178 of /.../includes/entity.inc).
• Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->cacheGet() (line 355 of /.../includes/entity.inc

j4’s picture

Using this patch removed the errors for me.

Thanks!
Jaya

leewillis77’s picture

The patch in #3 worked for us as well today - thanks sergiu.savva!

jenlampton’s picture

patch in #3 works for me as well. Thanks all!

japo32’s picture

thanks. #3 worked for me as well.

dstol’s picture

Version: 7.x-1.x-dev » 7.x-2.x-dev
Issue summary: View changes
Status: Reviewed & tested by the community » Fixed

Committed to both 7.x-2.x and 7.x-1.x. Thanks!

Status: Fixed » Closed (fixed)

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