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.
I get this error message per row:
Notice: Undefined property: stdClass::$id in editableviews_plugin_style_row_edit_table->insert_form_elements() (line 176 of /Users/username/Sites/sitename/drupal/builds/build_2013-04-19-152749/sites/all/modules/contrib/editableviews/editableviews_plugin_style_row_edit_table.inc).
We are using ECK module and Field collection, so it's not the most simple use case. But Editable Views works! I'd just like to know if there is a way to get rid of those notices. I don't have any idea where to start looking from.
Comment | File | Size | Author |
---|---|---|---|
#3 | undefined-property.patch | 994 bytes | jbennett |
Comments
Comment #1
joachim CreditAttribution: joachim commentedWhat's the relationship you're trying to connect new entities with?
Comment #2
Paul B CreditAttribution: Paul B commentedI'm getting the same error on a custom entity -> Relation -> Profile2 -> User view. The only entity that causes the error is the custom entity. It's provided by a contextual filter. If I add the custom entity's ID field to the view, the error goes away.
Comment #3
jbennett CreditAttribution: jbennett commentedI think the issue is just that you access the entity id property without checking that it is set. You handle the case of a null id immediately after. Patch attached.
Comment #4
joachim CreditAttribution: joachim commentedThat won't work, sorry. You must have an ID field present. In the Views result, it will still be present in $result_row, as a NULL value.
Comment #5
JacobSanfordHis patch does work for me for views with nested field collections.