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 upgraded to latest dev version (02-Aug-2011) and I get the following error messages:
Fatal error: Call to a member function render() on a non-object in ....\sites\all\modules\references\views\references_plugin_style.inc on line 32
Notice: Undefined index: access in node_reference_field_formatter_view() (line 394 of ...\sites\all\modules\references\node_reference\node_reference.module).
Notice: Undefined index: taxonomy_term in taxonomy_field_formatter_view() (line 1418 of ...\modules\taxonomy\taxonomy.module).
EntityMalformedException: Missing bundle property on entity of type taxonomy_term. in entity_extract_ids() (line 7383 of ...\includes\common.inc).
I'm not sure if they are all caused by this module.
Comment | File | Size | Author |
---|---|---|---|
#18 | node_reference.item-access.patch | 2.93 KB | John Franklin |
| |||
#12 | 1249268_node_reference_wsod-12.patch | 693 bytes | Aron Novak |
#9 | node_reference_php_warnings.patch | 655 bytes | mh86 |
Comments
Comment #1
chalee CreditAttribution: chalee commentedI have investigated the errors and managed to make them go away.
a) The first and last 2 errors went away when i removed the nodes which had taxonomy terms whose parent vocabulary I had deleted.
b) I noticed the 2nd error is actually a bug in node_reference.module. The issues are in function node_reference_field_formatter_view().
Problem 1: There is no implementation for display type 'node_reference_default' yet the function is in some instances being called with this display type
Temporary Fix: Combine first two cases
Problem 2: The statement $node = $item['node'] does not work for node reference field in a field_collection_item.
solution: load the node if entity_type is field_collection_item
Problem 3: The expression $item['access'] is also not available for node reference field in a field_collection_item.
Temporary Fix: disable/comment out checking for 'access'
Comment #2
tim.plunkettComing from #1250012: Notice: Undefined index: access in node_reference_field_formatter_view() .
The fix for problem 1 is redundant, that's how switch/case statements work, listing them back to back is a fall-through and is equivalent to what you've typed out.
While I was initially happy to hear it wasn't my bug, I still am not sure of this. References shouldn't care have to worry about field_collection_items, so the solution for problem 2 is likely not the best way. Though I'm not 100% on that.
When it's a field_collection_item, what is in
$item['node']
? If nothing, then this would be best:Comment #3
chalee CreditAttribution: chalee commented@tim.plunkett: Thanks. I agree with all your points. $item['node'] doesn't exist for field_collection_item, therefore your suggested statement is the best to cater for any other module which doesn't set the value. How about if ($item['access']) { , Is it proper to bypass that check here when $item['access'] is not set or some other module has to set it. Which module would that be? Perhaps field_collection which creates the field instance in the first place or entity that loads the entity?
Comment #4
chalee CreditAttribution: chalee commentedI'm noticing that this issue has far reaching effects. Apart from node reference it also affects field formatters for taxonomy and media modules i.e functions taxonomy_field_formatter_view() and media_field_formatter_view() respectively.
Comment #5
chrisroditis CreditAttribution: chrisroditis commentedSame problem here with node references and $item['access']. My node reference field is attached to a message entity (message.module) and I'm getting the Notice: Undefined index: access in node_reference_field_formatter_view() error
Comment #6
Jason Dean CreditAttribution: Jason Dean commentedSame issue here with References + Field Collection + Field Collection Table... subscribing.
Comment #7
mh86 CreditAttribution: mh86 commentedsubscribing, having the same problem
Comment #8
mh86 CreditAttribution: mh86 commentedI'm having a view with messages which have a node reference field attached. I use this field for filtering the messages via a contextual argument - so no content of the node reference is actually shown.
Nevertheless, I receive lots of "Undefined index: access ..." warnings. As I can see from the code node_reference_field_formatter_view() needs node_reference_field_formatter_prepare_view() first, which isn't invoked in my case. But why is a formatter function ever invoked when I'm not showing the field?
Comment #9
mh86 CreditAttribution: mh86 commentedhere a quick fix that prevents the warnings, but I'm not sure if it solves the original problem.
Comment #10
Sinan Erdem CreditAttribution: Sinan Erdem commentedI applied the patch on comment #9, but the error still appears on the status report page:
This alert appears when I run cron. I believe that, this also affects search indexing. I re-indexed my site. There are 7000 nodes. Each time I run cron, 500 items are indexed. It went well for first 5000 items. There was no error. Then for the last 2000 nodes, this error appeared on the "status report" page after I run cron. Remaining 2000 nodes arent indexed.
Comment #11
Sinan Erdem CreditAttribution: Sinan Erdem commentedWhen I look at the logs, I also see this error when I run cron:
Comment #12
Aron NovakTry this.
Comment #13
wozzz7 CreditAttribution: wozzz7 commentedThis patch worked for me
Comment #14
aaron.r.carlton CreditAttribution: aaron.r.carlton commentedI manually applied this patch to the 7.x-2.1 branch and it has appeared to fix the issue. It would be nice to get this into the next release.
Comment #15
charlie-s CreditAttribution: charlie-s commentedAlso solid and working for me.
Comment #16
Alex Andrascu CreditAttribution: Alex Andrascu commentedOk let's get it in then
Comment #17
newswatch CreditAttribution: newswatch commentedI tried both patches. Neither worked.
Comment #18
John Franklin CreditAttribution: John Franklin commentedThe patch in #9 doesn't seem to catch all cases of an unset
$item['access']
. Here is a patch that covers all the instances in the node_references.module file.Comment #19
Ramdas Gaikar CreditAttribution: Ramdas Gaikar commentedHello,
Can someone commit the changes done here so that it will be available in new release?
Thanks.
Comment #20
renatogYes, @ramdas-gaikar.
We will commit and will be available in the next release.
Regards.
Comment #22
renatogFixed.
Thank you very much for contribution people.
Commited in dev branch.
Good Work and Good Weekend.
Regards.