Project

General

Profile

Actions

Bug #82034

closed

f:be.widget.paginate manual paging not working correctly (solution included)

Added by Ronald Kools over 6 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Must have
Category:
Fluid
Target version:
-
Start date:
2017-08-03
Due date:
% Done:

100%

Estimated time:
0.25 h
TYPO3 Version:
8
PHP Version:
7.0
Tags:
fluid, widget, paginate
Complexity:
Is Regression:
Sprint Focus:

Description

See /typo3/sysext/fluid/Resources/Private/Templates/ViewHelpers/Be/Widget/Paginate/Index.html

When using this pager in a backendmodule the manual input fails. This is caused by the fact that the inline javascript uses a string comparison instead of integers:

12: if (page > numberOfPages) {
13: page = numberOfPages;
14: } else if (page < 1) {
15: page = 1;
16: }

Both page and numberOfPages are strings. In my case my page was "5" and the numberOfPages "219", which converts to true on line 12, causing page to be overwritten with numberOfPages and thus sending you to the last page instead of page 5.

Solution:

10: var numberOfPages = parseInt(formField.dataset.numberOfPages);
11: var page = parseInt(formField.value);


Files

widgetbug.png (4.01 KB) widgetbug.png See the highlighted area Ronald Kools, 2017-08-03 18:19
Actions #1

Updated by Ronald Kools over 6 years ago

Added an image with the highlighted area that is causing the problem.

Actions #2

Updated by Gerrit Code Review over 6 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53686

Actions #3

Updated by Wolfgang Klinger over 6 years ago

  • Assignee set to Wolfgang Klinger
Actions #4

Updated by Gerrit Code Review over 6 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53686

Actions #5

Updated by Gerrit Code Review over 6 years ago

Patch set 1 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53688

Actions #6

Updated by Wolfgang Klinger over 6 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #7

Updated by Benni Mack over 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF