Using entity query with a negative pager throws a MYSQL error.
Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-10' at line 8:

Proposed resolution

Return an absolute value when fetching the pager value.



falc0 created an issue. See original summary.

falc0’s picture

cilefen’s picture

Version: 8.2.x-dev » 8.3.x-dev
Status: Active » Needs review

It seems to me like the negative value would result from wanting something different from its absolute value. What is the use-case for negative values? Do pagers end up with negative values?

Status: Needs review » Needs work

The last submitted patch, 2: drupal-2871784-1.patch, failed testing.

falc0’s picture

There is no use-case for this. We found these errors in our watchdog and found out if you change the pager to a negative value this error shows.