When editing a node that uses a view reference field within a file collection we see:
Notice: Undefined index: arguments in viewreference_autocomplete_process() (line 927 of /.../sites/all/modules/contrib/viewreference/viewreference.module).
When saving we see:
Notice: Undefined index: skip_default in viewreference_autocomplete_validate() (line 339 of /.../sites/all/modules/contrib/viewreference/viewreference.module
There are just a couple of instances where array keys are being accessed without any checks to make sure actually exist first. Rolling a patch now...
Comments
Comment #1
srycroft commentedThis patch fixes it for me
Comment #2
srycroft commentedAfter further testing I discovered the same issue occurred when using the select list widget. Here is a revised patch that fixes both use cases.
Comment #3
james.williamsThe above patches don't actually respect the arguments settings when disabled, as they just check for isset() rather than checking the value with !empty().
Also, #parents is used at the top of the elements process functions to get the field name & language, but these assume knowledge of the structure of the form containing our element, which in some cases will be different - so Field API provides #field_name and #language for this very purpose anyway.
The attached patch should sort both of these notice-generating problems out.
Comment #4
pglynn commentedSeems like there's more than one solution to this. Would like to see this roll out in the beta version sometime soon since both of these approaches seems to fix the errors stemming from adding a viewreference field to a field collection. Here's another approach that works: https://drupal.org/node/1790304#comment-7395496
Comment #6
danielb commentedComment #7
danielb commentedComment #8
danielb commentedHad to ditch that patch, just causes a heap of errors
Comment #9
danielb commentedI think we'll continue this here https://drupal.org/node/1790304#comment-7395496