I get this on the creation of a new node. Here is a patch to fix.

Comments

webchimpAU’s picture

Issue summary: View changes

I am getting this error as well. Happens when I create a node that has an Entity Reference Count field using node_save but not when I create it through the admin area.

I tried the patch which got rid of the error but it also stopped the field from counting.

If anyone else is getting this error, this was my solution which seems to be working:

I changed line 223 from:

if (!empty($db)) {

to

if (!empty($db) && isset($entity->{$entity_info['entity keys']['id']})) {

mariacha1’s picture

Status: Active » Needs review
StatusFileSize
new495 bytes

Here's a patch for the alteration described in #1.

damienmckenna’s picture

Status: Needs review » Reviewed & tested by the community

The second patch is the correct one.

damienmckenna’s picture

damienmckenna’s picture

FYI the patch in #2 does fix the problem.

khalor’s picture

Can confirm patch in #2 fixes the issue

  • WorldFallz committed 1478031 on 7.x-1.x authored by mariacha1
    Issue #2106755 by RobKoberg, mariacha1, DamienMcKenna: Notice: Undefined...
WorldFallz’s picture

Status: Reviewed & tested by the community » Fixed

I couldn't replicate this behavior, but we have 2 separate confirmations that the patch fixes the issue, so committed and pushed to 7.x-1.x! Thanks everyone.

Status: Fixed » Closed (fixed)

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