[BUGFIX] Fix offset issue with maxSingleDBListItems 32/49732/2
authorWouter Wolters <typo3@wouterwolters.nl>
Thu, 1 Sep 2016 15:14:46 +0000 (17:14 +0200)
committerMorton Jonuschat <m.jonuschat@mojocode.de>
Fri, 2 Sep 2016 08:07:56 +0000 (10:07 +0200)
There is a + 1 that makes the limit always one higher than
the set value in maxSingleDBListItems.

Resolves: #77528
Releases: master,7.6
Change-Id: I2328aa23dd1457f6fd59150898d14ed427b521cc
Reviewed-on: https://review.typo3.org/49732
Tested-by: Bamboo TYPO3com <info@typo3.com>
Reviewed-by: Daniel Goerz <ervaude@gmail.com>
Tested-by: Daniel Goerz <ervaude@gmail.com>
Reviewed-by: Stefan Froemken <froemken@gmail.com>
Tested-by: Stefan Froemken <froemken@gmail.com>
Reviewed-by: Morton Jonuschat <m.jonuschat@mojocode.de>
Tested-by: Morton Jonuschat <m.jonuschat@mojocode.de>
typo3/sysext/recordlist/Classes/RecordList/AbstractDatabaseRecordList.php

index 1a1d8ae..2512f0e 100644 (file)
@@ -691,7 +691,7 @@ class AbstractDatabaseRecordList extends AbstractRecordList
             }
         }
         // Set LIMIT:
-        $limit = $this->iLimit ? ($this->firstElementNumber ? $this->firstElementNumber . ',' : '') . ($this->iLimit + 1) : '';
+        $limit = $this->iLimit ? ($this->firstElementNumber ? $this->firstElementNumber . ',' : '') . $this->iLimit : '';
         // Filtering on displayable pages (permissions):
         $pC = $table == 'pages' && $this->perms_clause ? ' AND ' . $this->perms_clause : '';
         // Adding search constraints:
@@ -810,7 +810,7 @@ class AbstractDatabaseRecordList extends AbstractRecordList
             'groupBy' => null,
             'orderBy' => null,
             'firstResult' => $this->firstElementNumber ?: null,
-            'maxResults' => $this->iLimit ? ($this->iLimit + 1) : null,
+            'maxResults' => $this->iLimit ? $this->iLimit : null,
         ];
 
         if ($this->sortField && in_array($this->sortField, $this->makeFieldList($table, 1))) {