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
- Install this module.
- Other steps: unclear? There might be additional context required to reproduce the error.
- Go to
/admin/config/system/site-information
and ensure the setting is empty.
- 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.