r105949 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r105948‎ | r105949 | r105950 >
Date:22:55, 12 December 2011
Author:yonishostak
Status:resolved (Comments)
Tags:
Comment:
AFTv5: attempt to avoid double preference setting for AFTv4 and AFTv5
Modified paths:
  • /trunk/extensions/ArticleFeedbackv5/ArticleFeedbackv5.hooks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ArticleFeedbackv5/ArticleFeedbackv5.hooks.php
@@ -267,11 +267,14 @@
268268 * @param $preferences
269269 */
270270 public static function getPreferences( $user, &$preferences ) {
271 - $preferences['articlefeedbackv5-disable'] = array(
272 - 'type' => 'check',
273 - 'section' => 'rendering/advancedrendering',
274 - 'label-message' => 'articlefeedbackv5-disable-preference',
275 - );
 271+ // need to check for existing key, if deployed simultaneously with AFTv4
 272+ if( !array_key_exists( 'articlefeedbackv5-disable', $preferences ) ) {
 273+ $preferences['articlefeedbackv5-disable'] = array(
 274+ 'type' => 'check',
 275+ 'section' => 'rendering/advancedrendering',
 276+ 'label-message' => 'articlefeedbackv5-disable-preference',
 277+ );
 278+ }
276279 return true;
277280 }
278281

Comments

#Comment by Catrope (talk | contribs)   22:00, 13 December 2011

Why would AFTv4 ever set 'articlefeedbackv5-disable' ?

#Comment by Catrope (talk | contribs)   22:00, 13 December 2011

Never mind, fixed in r105955.

Status & tagging log