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

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

foredoc created an issue. See original summary.

florisg’s picture

Priority: Critical » Normal
Status: Active » Needs review

Related 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)

jyraya’s picture

Hello,

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.

Status: Needs review » Needs work

The last submitted patch, 3: project_issue-entity_type_undefined-2676826.patch, failed testing. View results

jyraya’s picture

Version: 7.x-2.0-alpha2 » 7.x-2.x-dev
jyraya’s picture

Ok. It does not pass the composer step.

I check why it failed there.

  • drumm committed 907359f on 7.x-2.x authored by jyraya
    Issue #2676826 by jyraya: Undefined index: #entity_type in...
drumm’s picture

Status: Needs work » Fixed

Thanks for the detailed explanation, committed. (And testing is generally broken for this project for now.)

Status: Fixed » Closed (fixed)

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