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.
Hi,
I am playing with the issue tracking module, and am having the problem as follows whenever I view/edit an issue:
Notice: Undefined index: #entity_type in rdf_preprocess_field() (line 545 of C:\WWW\drupal-sandbox\modules\rdf\rdf.module)
Can anybody please suggest how to solve the problem?
Thanks.
Regards,
foredoc
Comment | File | Size | Author |
---|---|---|---|
#3 | project_issue-entity_type_undefined-2676826.patch | 1.09 KB | jyraya |
Comments
Comment #2
florisg CreditAttribution: florisg at 040lab commentedRelated RDF module patch fixes this issue.
https://www.drupal.org/node/2194131
This patch needs a reroll against 7.51 (succeeds with offset -6 lines)Comment #3
jyraya CreditAttribution: jyraya at European Commission and European Union Institutions, Agencies and Bodies commentedHello,
I was working on another issue when I found the #2194131: Notice: Undefined index: #entity_type in rdf_preprocess_field() issue.
In order to confirm a hypothesis, I decided to work on the current issue.
I found a problem in the module that generates the undefined index php notice.
I saw that in the "project_issue_node_view" hook that we attach 3 components like they are node type's fields (see line 831 to 872 of project_issue.module).
The bundle is always correctly set for each attached component but the entity type is never defined.
IMO, '#entity_type' item must be declared too because it is a mandatory data for fields. An actual field is always attached to an entity that has a type and a bundle.
You just have to look to the field_instance_field or field_view_field function parameter and implementation to see that the entity type is mandatory.
So, I do not think that the patch proposed in #2194131: Notice: Undefined index: #entity_type in rdf_preprocess_field() shoul be used as fix for this issue because it hides the actual cause of this issue; I.E. a malformed field array.
I made a patch based on this.
Comment #5
jyraya CreditAttribution: jyraya at European Commission and European Union Institutions, Agencies and Bodies commentedComment #6
jyraya CreditAttribution: jyraya at European Commission and European Union Institutions, Agencies and Bodies commentedOk. It does not pass the composer step.
I check why it failed there.
Comment #8
drummThanks for the detailed explanation, committed. (And testing is generally broken for this project for now.)