- Issue created by @ransomweaver
- Status changed to Postponed: needs info
over 1 year ago 11:15am 18 July 2023 - π³π±Netherlands Lendude Amsterdam
I tried to reproduce this in a clean Umami install on 11.x.
Added a view of recipes
Using the mini pager
Set the "Offset (number of items to skip)" to an empty value
Saved the view successfully
Loaded the view successfullyThen tried the same with the full pager and got the same results.
Am I missing a step here? Is there any way to reproduce this on a clean install of does it need to be an updated site?
- πΊπΈUnited States aangel
I'm upgrading to 10.1 and encountered this. The workaround that seems to be working for me is to use this local patch (didn't want to fork the issue since this is a complete hack):
In [project_root]/project/patches, place the code below in ViewsPagerOffset.patch:
--- a/core/modules/views/src/Plugin/views/query/QueryPluginBase.php +++ b/core/modules/views/src/Plugin/views/query/QueryPluginBase.php @@ -149,7 +149,12 @@ * Set an OFFSET on the query, specifying a number of results to skip. */ public function setOffset($offset) { - $this->offset = $offset; + if (is_null($offset)) { + $this->offset = 0; + } + else { + $this->offset = $offset; + } } /**
In composer, make sure Cameron's patching plugin is installed:
"cweagans/composer-patches": "^1.7",
In the extras section, create an entry to apply the local patch:
"extra": { "enable-patching": true, "patches": { "drupal/core": { "Views pager offset causes fatal error if empty": "project/patches/ViewsPagerOffset.patch" } },
Remove core:
rm -Rf web/core
Run composer:
composer update
You should see something like:
- Installing drupal/core (10.1.1): Extracting archive - Applying patches for drupal/core project/patches/ViewsPagerOffset.patch (Views pager offset causes fatal error if empty)
Of course, finding out what changed between 9.5 and 10.1 and fixing that is the better solution.
- Open on Drupal.org βEnvironment: PHP 8.2 & MySQL 8last update
over 1 year ago Not currently mergeable. - @tobas1996 opened merge request.
- First commit to issue fork.
- last update
over 1 year ago 29,457 pass - Status changed to Closed: duplicate
about 1 year ago 3:27pm 2 November 2023