Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Notice: Undefined property: Entity::$id in eck_entity_view_alter() (line 888 of sites/all/modules/contrib/eck/eck.module).
Request URI: https://doimain.com/system/ajax
Referrer URI: https://doimain.com/node/23178/edit
Location http://example.com/system/ajax
Referrer http://example.com/node/23178/edit?destination=admin/content
Notice: Undefined property: Entity::$id in eck__entity__label() (line 147 of /sites/all/modules/contrib/eck/eck.module).
Location http://example.com/system/ajax
Referrer http://example.com/node/23178/edit?destination=admin/content
Notice: Undefined property: Entity::$id in eck__entity__label() (line 136 of /sites/all/modules/contrib/eck/eck.module).
http://example.com/system/ajax
Referrer http://example.com/node/23178/edit?destination=admin/content
Notice: Undefined property: Entity::$id in eck__entity__label() (line 136 of /sites/all/modules/contrib/eck/eck.module).
http://example.com/system/ajax
Referrer http://example.com/node/23178/edit?destination=admin/content
Notice: Undefined property: Entity::$id in eck__entity__label() (line 136 of /sites/all/modules/contrib/eck/eck.module).
http://example.com/system/ajax
Referrer http://example.com/node/23178/edit?destination=admin/content
Notice: Undefined property: Entity::$id in eck__entity__view_callback() (line 547 of /sites/all/modules/contrib/eck/eck.entity.inc).
Location http://example.com/system/ajax
Referrer http://example.com/node/23178/edit?destination=admin/content
Notice: Undefined property: Entity::$id in eck__entity__view_callback() (line 542 of /sites/all/modules/contrib/eck/eck.entity.inc).
Proposed resolution
Use entity_id()
function to get the proper entity identifier.
Remaining tasks
User interface changes
API changes
Data model changes
Comment | File | Size | Author |
---|---|---|---|
#7 | notice_undefined-2607746-7.patch | 6.45 KB | joelpittet |
#5 | notice_undefined-2607746-5.patch | 6.47 KB | joelpittet |
#3 | notice_undefined-2607746-3.patch | 6.59 KB | joelpittet |
#2 | notice_undefined-2607746-2.patch | 589 bytes | joelpittet |
Comments
Comment #2
joelpittet$entity->id
may not always exist.Comment #3
joelpittetHere's a better approach because I got a bunch of the same error in different spots of ECK.
Comment #4
joelpittetAdded all the location notices I have from a recent bout of this in watchdog.
Comment #5
joelpittetI keep getting the wrong version... anyways this is just a re-roll because head moved.
Comment #6
joelpittetWill likely conflict with #2619920: Possible spelling mistake in variable name: $tile instead of $title. If you commit that I'll re-roll this again.
Comment #7
joelpittetRe-rolled.
Comment #9
fmizzell CreditAttribution: fmizzell commentedComment #10
joelpittetThank you @fmizzell