r44389 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r44388‎ | r44389 | r44390 >
Date:08:15, 10 December 2008
Author:werdna
Status:ok
Tags:
Comment:
Configure extension fixes:
* Fix 'delete this entry' buttons for group permissions.
* Fix redirection to success page even on error.
Modified paths:
  • /trunk/extensions/Configure/Configure.js (modified) (history)
  • /trunk/extensions/Configure/SpecialConfigure.php (modified) (history)
  • /trunk/extensions/Configure/SpecialExtensions.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Configure/SpecialExtensions.php
@@ -31,8 +31,10 @@
3232 $new = $this->removeDefaults( $new );
3333 $new['__includes'] = $this->getRequiredFiles();
3434 $ok = $wgConf->saveNewSettings( $new, $this->mWiki, $reason );
 35+
 36+ $result = $ok ? 'success' : 'failure';
3537
36 - $url = $this->getTitle()->getLocalURL( 'result=success' );
 38+ $url = $this->getTitle()->getLocalURL( "result=$result" );
3739 $wgOut->redirect( $url );
3840 }
3941
Index: trunk/extensions/Configure/Configure.js
@@ -646,6 +646,7 @@
647647 r = table.getElementsByTagName( 'tr' ).length;
648648 startName = 'wp' + table.id;
649649 var groupname = prompt( wgConfigurePromptGroup );
 650+ var tbody = table.getElementsByTagName( 'tbody' )[0];
650651 if( groupname == null )
651652 return;
652653
@@ -680,7 +681,7 @@
681682 tr.appendChild( td1 );
682683 tr.appendChild( td2 );
683684 tr.appendChild( td3 );
684 - table.appendChild( tr );
 685+ tbody.appendChild( tr );
685686 }
686687
687688 /**
@@ -692,7 +693,8 @@
693694 function removeGroupBoolRow( table, r ){
694695 var trs = table.getElementsByTagName( 'tr' );
695696 var tr = trs[r];
696 - table.removeChild( tr );
 697+ var tbody = table.getElementsByTagName( 'tbody' )[0];
 698+ tbody.removeChild( tr );
697699 }
698700
699701 /**
Index: trunk/extensions/Configure/SpecialConfigure.php
@@ -29,8 +29,9 @@
3030 if ( $wgConfigureUpdateCacheEpoch )
3131 $settings['wgCacheEpoch'] = max( $settings['wgCacheEpoch'], wfTimestampNow() );
3232 $ok = $wgConf->saveNewSettings( $settings, $this->mWiki, $reason );
 33+ $result = $ok ? 'success' : 'failure';
3334
34 - $url = $this->getTitle()->getLocalURL( 'result=success' );
 35+ $url = $this->getTitle()->getLocalURL( "result=$result" );
3536 $wgOut->redirect( $url );
3637 }
3738

Status & tagging log