This issue is a clone of work that had been done on Drupal 8, but not ported to Drupal 7. See: https://www.drupal.org/node/1278052.
Currently hook_field_attach_view_alter() is the most reliable way to add output to entities. Currently metatags is using it to output the metatags for an entity. Problem is we add normal render array output which causes a PHP notice (undefined index "#field_type') in rdf_field_attach_view_alter() which assumes $output is nothing but field API fields - which is an untrue assumption. This can be resolved with a simple check with isset(). This also needs to be fixed in the example code for hook_field_attach_view_alter().
Comment | File | Size | Author |
---|---|---|---|
#9 | rdf_module_php_notice_isset-2356541-9.patch | 1.75 KB | earthday47 |
#6 | rdf_module_php_notice_isset-2356541-6.patch | 1.74 KB | labboy0276 |
#4 | rdf_module_php_notice_isset-2356541-2.patch | 1.68 KB | nwehner |
#1 | rdf_module_php_notice_isset-2356541-1.patch | 877 bytes | nwehner |
Comments
Comment #1
nwehner CreditAttribution: nwehner commentedAttached is a patch with the simple isset statement.
Comment #2
nwehner CreditAttribution: nwehner commentedComment #4
nwehner CreditAttribution: nwehner commentedHelps to update Field API, too!
Comment #6
labboy0276 CreditAttribution: labboy0276 at Tandem commentedHello,
I am reviving this issue, I started getting this lovely error:
Notice: Undefined index: #formatter in rdf_field_attach_view_alter() (line 745 of /modules/rdf/rdf.module).
This patch comes close to addressing the issue, so I tweaked it a little to fix it for this instance.
Comment #7
labboy0276 CreditAttribution: labboy0276 commentedComment #9
earthday47Re-rolled patch after 6 years!