jenkins-bot has submitted this change and it was merged.

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(-)

Approvals:
  Mwalker: Looks good to me, approved
  jenkins-bot: Verified



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: merged
Gerrit-Change-Id: I280ce82b67a8a25f5bfb9075f34c2db4ef542d00
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/BookManagerv2
Gerrit-Branch: master
Gerrit-Owner: Mollywhite <[email protected]>
Gerrit-Reviewer: Mwalker <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to