Mollywhite has uploaded a new change for review.
https://gerrit.wikimedia.org/r/74490
Change subject: Bug 51591: NS_MAIN pages break on JSON edge cases.
......................................................................
Bug 51591: NS_MAIN pages break on JSON edge cases.
When the JSON sections array was empty, or when the title of the
NS_MAIN page was not included in the section array, the whole
page would break due to a counting issue.
Bug: 51591
Change-Id: I280ce82b67a8a25f5bfb9075f34c2db4ef542d00
---
M BookManagerv2.hooks.php
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BookManagerv2
refs/changes/90/74490/1
diff --git a/BookManagerv2.hooks.php b/BookManagerv2.hooks.php
index 5fe15af..e0a12e6 100644
--- a/BookManagerv2.hooks.php
+++ b/BookManagerv2.hooks.php
@@ -350,7 +350,7 @@
$prev->link =
$jsonBook->sections[ $key - 1 ]->link;
}
- if ( $key !== count(
$jsonBook->sections ) ) {
+ if ( $key !== ( count(
$jsonBook->sections ) - 1 ) ) {
$next = (object)
array();
$next->title =
$jsonBook->sections[ $key + 1 ]->name;
--
To view, visit https://gerrit.wikimedia.org/r/74490
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I280ce82b67a8a25f5bfb9075f34c2db4ef542d00
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BookManagerv2
Gerrit-Branch: master
Gerrit-Owner: Mollywhite <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits