Nikerabbit has uploaded a new change for review.
https://gerrit.wikimedia.org/r/141118
Change subject: Fix undefined index help in search profiles
......................................................................
Fix undefined index help in search profiles
Same code as in I17cc79c
Change-Id: Idcb59c6b0a937d7ed7c030b809a6d41ab68f9d4d
---
M classes/Hooks.php
1 file changed, 14 insertions(+), 1 deletion(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/LiquidThreads
refs/changes/18/141118/1
diff --git a/classes/Hooks.php b/classes/Hooks.php
index ffc7757..8140150 100644
--- a/classes/Hooks.php
+++ b/classes/Hooks.php
@@ -334,7 +334,20 @@
),
);
- $profiles = wfArrayInsertAfter( $profiles, $insert, 'help' );
+ // Insert translations before 'all'
+ $index = array_search( 'all', array_keys( $profiles ) );
+
+ // Or just at the end if all is not found
+ if ( $index === false ) {
+ wfWarn( '"all" not found in search profiles' );
+ $index = count( $profiles );
+ }
+
+ $profiles = array_merge(
+ array_slice( $profiles, 0, $index ),
+ $insert,
+ array_slice( $profiles, $index )
+ );
return true;
}
--
To view, visit https://gerrit.wikimedia.org/r/141118
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Idcb59c6b0a937d7ed7c030b809a6d41ab68f9d4d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/LiquidThreads
Gerrit-Branch: master
Gerrit-Owner: Nikerabbit <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits