Nondescript error when trying to edit Exposed Form Style settings in view

Created on 20 August 2024, 27 days ago
Updated 4 September 2024, 12 days ago

Just updated from 6.x to 7.x on core 10.3.2. I ran the DB updates. I added the jquery_ui modules that I needed to add to my composer file. When I try to edit the BEF settings in my views that use it, no modal opens; the message area shows "Oops, something went wrong. Check your browser's developer console for more details." Nothing appears in the error log. I tried disabling/re-enabling the module, which did not help.

πŸ› Bug report
Status

Fixed

Version

7.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @bhogue
  • πŸ‡©πŸ‡ͺGermany rauch

    Same on my site.

    Browser Console:
    "
    Ein AJAX-HTTP-Fehler ist aufgetreten.
    HTTP-RΓΌckgabe-Code: 200
    Debugging information follows.
    Statustext: parsererror
    Antworttext:
    Fatal error: Declaration of Drupal\facets\Plugin\better_exposed_filters\filter\Facets::isApplicable($filter = null, array $filter_options = []) must be compatible with Drupal\better_exposed_filters\Plugin\better_exposed_filters\filter\FilterWidgetBase::isApplicable(mixed $filter = null, array $filter_options = []): bool in /var/www/html/web/modules/contrib/facets/src/Plugin/better_exposed_filters/filter/Facets.php on line 74"

  • πŸ‡ΊπŸ‡¦Ukraine zegmant

    the same on 7.0.1

  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    So those errors appear to be from facets and select2.

    Maybe we can put some defensive code in but that appears to be the source

  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    In 7.0.x we added typehints since minimum php requirement is 8.1

    Wonder if that's the issue.

  • πŸ‡ΊπŸ‡¦Ukraine zegmant

    php8.3.10 at my case

  • πŸ‡ΊπŸ‡¦Ukraine zegmant

    tried to set select2 in bef via direct editing of views config (for field_country_target_id filter)

          exposed_form:
            type: bef
            options:
              submit_button: Apply
              reset_button: true
              reset_button_label: Reset
              exposed_sorts_label: 'Sort by'
              expose_sort_order: true
              sort_asc_label: Asc
              sort_desc_label: Desc
              text_input_required: 'Select any filter and click on Apply to see results'
              text_input_required_format: null
              bef:
                general:
                  autosubmit: false
                  autosubmit_exclude_textfield: false
                  autosubmit_textfield_delay: 500
                  autosubmit_hide: false
                  input_required: false
                  allow_secondary: false
                  secondary_label: 'Advanced options'
                  secondary_open: false
                  reset_button_always_show: false
                sort:
                  plugin_id: default
                filter:
                  combine:
                    plugin_id: default
                  field_country_target_id:
                    plugin_id: bef_select2
                    advanced:
                      placeholder_text: 'Country'
                      rewrite:
                        filter_rewrite_values: ''
                        filter_rewrite_values_key: false
                      collapsible: false
                      collapsible_disable_automatic_open: false
                      is_secondary: false

    when viewing the page frontend it goes into the same error:

    Fatal error: Declaration of Drupal\select2\Plugin\better_exposed_filters\filter\Select2::defaultConfiguration() must be compatible with Drupal\better_exposed_filters\Plugin\better_exposed_filters\filter\FilterWidgetBase::defaultConfiguration(): array in /var/www/unh-new/web/modules/contrib/select2/src/Plugin/better_exposed_filters/filter/Select2.php on line 21

    (but i see no logs in the watchdog)

  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    FilterWidgetBase::defaultConfiguration(). if you remove the typehint does it work?

  • πŸ‡ΊπŸ‡¦Ukraine zegmant

    sorry, i do not understand how to remove it

  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    if you go into the file and change public function defaultConfiguration(): array { to public function defaultConfiguration() {

    ideally the other modules would update for modern typehints but know that's the case.

  • πŸ‡ΊπŸ‡¦Ukraine zegmant

    i'm not programmer, just advanced drupal user. can you instruct wher to find the file?

  • πŸ‡ΊπŸ‡¦Ukraine zegmant

    found, better_exposed_filters/src/Plugin/better_exposed_filters/filter/FilterWidgetBase.php line 74
    changed.
    no changes, the same error

  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Left a comment on ✨ BEF 7.0 compatible RTBC also

  • Status changed to Needs review 19 days ago
  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Not thrilled but if other modules are going to break I can drop the typehint here till it's mandatory.

  • πŸ‡ΊπŸ‡ΈUnited States smustgrave
  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Don't mind reverting this so other contrib modules will function. But when D11 only branch is started may get added back.

  • Status changed to Fixed 12 days ago
Production build 0.71.5 2024