Fatal error on 404 pages

Created on 23 August 2025, about 2 months ago

Problem/Motivation

I don't have permission to do this, but IMO 🐛 Error when added to 404 pages Postponed: needs info should be re-opened and this issue should be closed. The bug described there hasn't been fixed.

With this module installed and using the default page.404 config used (an empty string), going to a URL that causes a 404 error makes Drupal throw a fatal PHP error (The website encountered an unexpected error. Try again later.).

With 7.0.x of this module, the specific error is:

Symfony\Component\Routing\Exception\ResourceNotFoundException: No routes found

Drupal\Core\Url::createFromRequest() (Line: 184)
Drupal\better_exposed_filters\Plugin\BetterExposedFiltersWidgetBase->getExposedFormActionUrl() (Line: 74)

With 7.1.x of this module, the error is:

InvalidArgumentException: The user-entered string '' must begin with a '/', '?', or '#'. in Drupal\Core\Url::fromUserInput() (line 216 of core/lib/Drupal/Core/Url.php).
Drupal\better_exposed_filters\Plugin\BetterExposedFiltersWidgetBase->getExposedFormActionUrl() (Line: 117)

Steps to reproduce

  1. Install this module.
  2. Other steps: unclear? There might be additional context required to reproduce the error.
  3. Go to /admin/config/system/site-information and ensure the setting is empty.
  4. Go to a non-existent page, like /something-something-something-we-win.

Proposed resolution

The PHP error is being thrown from the code in Drupal\better_exposed_filters\Plugin\BetterExposedFiltersWidgetBase::getExposedFormActionUrl().

Fix this in both the 7.1.x branch and 7.0.x branch.

🐛 Bug report
Status

Active

Version

7.1

Component

Code

Created by

🇹🇼Taiwan johnalbin Taipei, Taiwan

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024