We have a content type "Somali Page" that we want to refer to a Site Page ('English Page'). We added a dropdown node reference field to Somali Page and select a parent English Site page (About Us). When we view the Somali Page, we get these error messages:
Notice: Undefined index: node in node_reference_field_formatter_view() (line 435 of /var/www/dev.oneearthfuture.org/htdocs/sites/all/modules/contrib-stable/references/node_reference/node_reference.module).
EntityMalformedException: Missing bundle property on entity of type node. in entity_extract_ids() (line 7734 of /var/www/dev.oneearthfuture.org/htdocs/includes/common.inc).
Here is the code snippet leading up to that code
$settings = $display['settings'];
$result = array();
switch ($display['type']) {
case 'node_reference_default':
case 'node_reference_plain':
foreach ($items as $delta => $item) {
if ($item['access']) {
$node = $item['node'];
Here is the Items array that code was processing:
[0] => Array
(
[nid] => 15
[access] => 1
)
As you can see, the code is looking for [node], but the array only carries a [nid].
Methinks this is a version incompatibility between References and Fields?
I can modify this pretty easily:
$nid = $item['nid'];
$node = node_load($nid);
, but do you have a patch, are you working on the issue?
Comment | File | Size | Author |
---|---|---|---|
#1 | notice_undefined-2297511-1.patch | 562 bytes | renatog |
Comments
Comment #1
renatogHi!
Thank you very much for reporting.
This error was fixed. Exists new logic for check if node exists, and if not exists was used
node_lod($nid)
for get the node.Good Work.
Comment #3
renatog