Error with Views Infinite Scroll

Created on 26 January 2023, over 1 year ago
Updated 7 February 2023, over 1 year ago

Problem/Motivation

When using the module "Views Infinite Scroll" and enable the option "Initially load all pages up to the requested page" there is a Exception when visiting the site with a parameter like "?page=2".

Error Message:
Drupal\Core\Database\DatabaseExceptionWrapper: Exception in Job List[job_list]: 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 '-1' at line 5: SELECT "node_field_data"."created" AS "node_field_data_created", "node_field_data"."nid" AS "nid", "node_field_data"."langcode" AS "node_field_data_langcode" FROM "node_field_data" "node_field_data" LEFT JOIN "node__field_ [...] ORDER BY "node_field_data_created" DESC LIMIT 18 OFFSET -1; Array ( [:db_condition_placeholder_1] => 1 [:db_condition_placeholder_2] => job [:db_condition_placeholder_3] => de [:db_condition_placeholder_4] => 0 [:views_join_condition_0] => 0 ) in main() (line 19 of /server/web/index.php).

Steps to reproduce

  1. Set up views_inject
  2. Set up views_infinite_scroll
  3. Enable option "Initially load all pages up to the requested page" in views pager settings.
  4. Go to page of the view with the URL parameter page e.g. "?page=2" to load all results up to page 3

Proposed resolution

Remaining tasks

User interface changes

πŸ› Bug report
Status

Active

Version

1.2

Component

Code

Created by

πŸ‡©πŸ‡ͺGermany rauch

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

Comments & Activities

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

    I added a check if the option
    $pager->options["views_infinite_scroll"]["initially_load_all_pages"]
    is set and adjusted the variables accordingly.

  • @rauch opened merge request.
Production build 0.69.0 2024