Bug #28283
Paginate Widget does not highlight current page
Status: | Resolved | Start date: | 2011-07-18 | |
---|---|---|---|---|
Priority: | Should have | Due date: | ||
Assigned To: | Bastian Waidelich | % Done: | 100% |
|
Category: | Widgets | |||
Target version: | - | |||
Has patch: | No | Affected Flow version: | (any) |
Description
The line
$pages[] = array('number' => $i, 'isCurrent' => ($i === $this->currentPage));
PaginateController::buildPagination() fails to set 'isCurrent' correctly for certain pages because $i is of type float and thus not (type safe) equal to $this->currentPage.
Associated revisions
[BUGFIX] Paginate Widget does not highlight current page
The "isCurrent" property of a page is not set correctly for certain
pages because the PaginationController fails to cast values to
integers.
This change fixes this.
Change-Id: I9fda9b95be1f21df56aed0d7f5356d544aa86f85
Resolves: #28283
[BUGFIX] Paginate Widget: Correctly highlight current page
With #28283 the current page is correctly highlighted most of the
time. But if a non-existing page is requested (for example by
manually setting the currentPage-argument to a number higher than
the number of total pages) the last page should be highlighted, but
is not.
That is fixed with this change by making sure that ``numberOfPages``
is always an integer.
Change-Id: Ie1c0238d570040501b3194962135082fbad0ee6d
Related: #28283
Releases: master, 2.2, 2.1
[BUGFIX] Paginate Widget: Correctly highlight current page
With #28283 the current page is correctly highlighted most of the
time. But if a non-existing page is requested (for example by
manually setting the currentPage-argument to a number higher than
the number of total pages) the last page should be highlighted, but
is not.
That is fixed with this change by making sure that ``numberOfPages``
is always an integer.
Change-Id: Ie1c0238d570040501b3194962135082fbad0ee6d
Related: #28283
Releases: master, 2.2, 2.1
[BUGFIX] Paginate Widget: Correctly highlight current page
With #28283 the current page is correctly highlighted most of the
time. But if a non-existing page is requested (for example by
manually setting the currentPage-argument to a number higher than
the number of total pages) the last page should be highlighted, but
is not.
That is fixed with this change by making sure that ``numberOfPages``
is always an integer.
Change-Id: Ie1c0238d570040501b3194962135082fbad0ee6d
Related: #28283
Releases: master, 2.2, 2.1
History
#1 Updated by Bastian Waidelich about 4 years ago
- Subject changed from Paginate Widget fails to cast current page to integer to Paginate Widget does not highlight current page
#2 Updated by Mr. Hudson about 4 years ago
Patch set 1 of change I9fda9b95be1f21df56aed0d7f5356d544aa86f85 has been pushed to the review server.
It is available at http://review.typo3.org/3395
#3 Updated by Bastian Waidelich about 4 years ago
- Status changed from Accepted to Under Review
#4 Updated by Bastian Waidelich about 4 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset fca5d265f7797ae156e729258e20183daf246089.
#5 Updated by Georg Tiefenbrunn over 1 year ago
$this->numberOfPages = ceil(...);
in initializeAction() returns a float and should also be converted to integer. If there are 10 pages and you manually set 'currentPage' to 11+, 'isCurrent' is still incorrectly set.
#6 Updated by Bastian Waidelich over 1 year ago
- Status changed from Resolved to Accepted
- Affected Flow version set to (any)
Georg Tiefenbrunn wrote:
$this->numberOfPages = ceil(...);
in initializeAction() returns a float and should also be converted to integer. If there are 10 pages and you manually set 'currentPage' to 11+, 'isCurrent' is still incorrectly set.
Thanks for the feedback, I'll look into this asap
#7 Updated by Bastian Waidelich about 1 year ago
Bastian Waidelich wrote:
Thanks for the feedback, I'll look into this asap
cough sorry, I lost track of this one somehow.. Finally managed to insert the 9 characters: https://review.typo3.org/30119
#8 Updated by Bastian Waidelich about 1 year ago
- Status changed from Accepted to Under Review
#9 Updated by Bastian Waidelich 8 months ago
- Status changed from Under Review to Resolved
This has been merged in june already (see https://review.typo3.org/30119)