Hi,
I have made a couple of views with views, BEF and Display suite but I get the following error message.
Notice: Undefined index: label in better_exposed_filters_exposed_form_plugin->exposed_form_alter() (line 906 of .../sites/all/modules/better_exposed_filters/better_exposed_filters_exposed_form_plugin.inc).
Notice: Undefined index: label in better_exposed_filters_exposed_form_plugin->exposed_form_alter() (line 906 of .../sites/all/modules/better_exposed_filters/better_exposed_filters_exposed_form_plugin.inc).
Notice: Undefined index: label in better_exposed_filters_exposed_form_plugin->exposed_form_alter() (line 906 of .../sites/all/modules/better_exposed_filters/better_exposed_filters_exposed_form_plugin.inc).
Notice: Undefined index: label in better_exposed_filters_exposed_form_plugin->exposed_form_alter() (line 906 of .../sites/all/modules/better_exposed_filters/better_exposed_filters_exposed_form_plugin.inc).
The view is set to display Display suite elements and I use an exposed filters on block. I get exactly the same on a similar view with maps but when I choose to show fields instead of DS elements, the notifications disappear.
Any ideas what could be causing this and what can I do to fix it?
If you need any further info just ask.
Thanks
Comment | File | Size | Author |
---|---|---|---|
#18 | better_exposed_filters-2050537-18-fix-php-notice.patch | 903 bytes | mikeytown2 |
#14 | better_exposed_filters-2050537-14-fix-php-notice.patch | 743 bytes | mikeytown2 |
#11 | better_exposed_filters-undef_index_label_fix-2050537-7.patch | 1.89 KB | anschultz |
#3 | exportmap.txt | 15.16 KB | funkycamel |
#3 | export1.txt | 18.9 KB | funkycamel |
Comments
Comment #1
trevorkjorlien CreditAttribution: trevorkjorlien commentedI'm getting this error too, but I don't think it's related to Display Suite. Line 906 in the file is:
$secondary[$identifier]['#title'] = $form['#info']["filter-$label"]['label'];
This issue discusses the label of the Secondary Options form: #1852306: Text of the "Secondary options label" cannot be translated. Are you using the Secondary Options form in one of your Views but not the other?
Comment #2
mikeker CreditAttribution: mikeker commentedPlease include an export of the View in question. Otherwise there's no way for me to know the details of your situation.
Thanks.
Comment #3
funkycamel CreditAttribution: funkycamel commentedPlease find attached views exports and screenshots of the output.
Thanks in advance.
Comment #4
funkycamel CreditAttribution: funkycamel commentedI use secondary options on both variations. You can have a look.
http://malta-home.com/commercial#overlay-context=
This is the one that it prompts me the message.
When I show fields instead of DS elements the error disappears
And here is another view with the same filters plus more (default taxonomy view- uses default contextual filters). No error.
Comment #5
funkycamel CreditAttribution: funkycamel commentedWhen I activate the secondary options it happens. I guess it is the same with https://drupal.org/node/1852306.
So I guess beside that quick fix there isn't anything else so far. Better than nothing I guess.
Thank you all.
funkycamel
Comment #6
miromarchi CreditAttribution: miromarchi commentedHi, I see the same notice:
Notice: Undefined index: label in better_exposed_filters_exposed_form_plugin->exposed_form_alter() (line 906 of /better_exposed_filters/better_exposed_filters_exposed_form_plugin.inc)
I don't use DS.
I use BEF setting "Enable secondary exposed form options" with a custom label.
I don't use exposed form setting "Exposed form in block".
I've tried changing line 372 as suggested by ptmkenny in https://drupal.org/comment/7032098#comment-7032098 but I couln'd get rid of the notice.
Comment #7
anschultz CreditAttribution: anschultz commentedIn better_exposed_filters_exposed_form_plugin.inc there are some unset($form['#info']["filter-$label"]['label']); inside the foreach ($settings as $label => $options) above where the secondary elements are evaluated. Meaning that if you are using radio buttons or checkboxes in a collapsible fieldset, then the 'label' is getting unset before it can be indexed in line 906, thus the error messages.
I fixed it by tracking the 'label' with a temporary variable and changing how $secondary[$identifier]['#title'] in line 906 is set.
Comment #8
anschultz CreditAttribution: anschultz commentedComment #9
anschultz CreditAttribution: anschultz commentedI have a patch, but I'm not sure how to attach it here. I changed the status to 'needs review' per https://drupal.org/patch/submit, but I'm still not seeing any options. Anybody know?
Comment #10
mikeker CreditAttribution: mikeker commented@anschultz: You need to click the "Update this issue" link to change status or attach a patch to an issue. Make sure to change the status to "Need review" to trigger the testbot to run your patch through the usual bank of tests.
Thanks.
Comment #11
anschultz CreditAttribution: anschultz commentedComment #13
mikeytown2 CreditAttribution: mikeytown2 commentedEncountering something similar and have a fix.
Notice: Undefined index: filter-field_basic_primarylocation_administrative_area in better_exposed_filters_exposed_form_plugin->exposed_form_alter() (line 896 of better_exposed_filters/better_exposed_filters_exposed_form_plugin.inc).
This should help explain what is wrong: Debug output below.
This
$field_id = $form['#info']["filter-$label"]['value'];
should be this
$field_id = $form['#info']["filter-{$filters[$label]->options['group_info']['identifier']}"]['value'];
Comment #14
mikeytown2 CreditAttribution: mikeytown2 commentedComment #16
mikeytown2 CreditAttribution: mikeytown2 commentedComment #17
mikeytown2 CreditAttribution: mikeytown2 commented14: better_exposed_filters-2050537-14-fix-php-notice.patch queued for re-testing.
Comment #18
mikeytown2 CreditAttribution: mikeytown2 commentedUsing the new way as a fallback in case the old way doesn't work.
Comment #20
mikeker CreditAttribution: mikeker commented