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

Also available in: Atom PDF