r97673 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r97672‎ | r97673 | r97674 >
Date:22:36, 20 September 2011
Author:reedy
Status:ok (Comments)
Tags:
Comment:
Modified paths:
  • /branches/REL1_18/phase3/RELEASE-NOTES-1.18 (modified) (history)
  • /branches/REL1_18/phase3/includes/AutoLoader.php (modified) (history)
  • /branches/REL1_18/phase3/includes/Collation.php (modified) (history)
  • /branches/REL1_18/phase3/includes/DefaultSettings.php (modified) (history)
  • /branches/REL1_18/phase3/includes/OutputPage.php (modified) (history)
  • /branches/REL1_18/phase3/includes/installer/MysqlUpdater.php (modified) (history)
  • /branches/REL1_18/phase3/includes/installer/SqliteUpdater.php (modified) (history)
  • /branches/REL1_18/phase3/includes/profiler/Profiler.php (modified) (history)
  • /branches/REL1_18/phase3/includes/resourceloader/ResourceLoaderContext.php (modified) (history)
  • /branches/REL1_18/phase3/maintenance/deleteBatch.php (modified) (history)
  • /branches/REL1_18/phase3/resources/mediawiki/mediawiki.js (modified) (history)
  • /branches/REL1_18/phase3/skins/CologneBlue.php (modified) (history)
  • /branches/REL1_18/phase3/skins/MonoBook.php (modified) (history)
  • /branches/REL1_18/phase3/skins/Simple.php (modified) (history)
  • /branches/REL1_18/phase3/skins/Standard.php (modified) (history)
  • /branches/REL1_18/phase3/skins/common/shared.css (modified) (history)
  • /branches/REL1_18/phase3/skins/monobook/IE70Fixes.css (modified) (history)

Diff [purge]

Index: branches/REL1_18/phase3/maintenance/deleteBatch.php
@@ -87,8 +87,10 @@
8888 if ( $page->getNamespace() == NS_FILE ) {
8989 $art = new ImagePage( $page );
9090 $img = wfFindFile( $art->mTitle );
91 - if ( !$img || !$img->delete( $reason ) ) {
92 - $this->output( "FAILED to delete image file... " );
 91+ if ( !$img
 92+ || !$img->isLocal()
 93+ || !$img->delete( $reason ) ) {
 94+ $this->output( " FAILED to delete image file... " );
9395 }
9496 } else {
9597 $art = new Article( $page );
@@ -96,7 +98,7 @@
9799 $success = $art->doDeleteArticle( $reason );
98100 $dbw->commit();
99101 if ( $success ) {
100 - $this->output( "\n" );
 102+ $this->output( " Deleted!\n" );
101103 } else {
102104 $this->output( " FAILED to delete article\n" );
103105 }
Index: branches/REL1_18/phase3/skins/Simple.php
@@ -42,7 +42,7 @@
4343 $rules[] = "a.stub:after { $underline; }";
4444 }
4545 $style = implode( "\n", $rules );
46 - $out->addInlineStyle( $style, /* flip css if RTL */true );
 46+ $out->addInlineStyle( $style, 'flip' );
4747
4848 }
4949 }
Index: branches/REL1_18/phase3/skins/monobook/IE70Fixes.css
@@ -9,6 +9,9 @@
1010 height: 1%;
1111 }
1212
 13+.rtl div#column-content div#content { margin-right: 12.2em; margin-left: 0; }
 14+
 15+
1316 .rtl div#column-one {
1417 /* For some reason it tries to inherit the padding-top into every div,
1518 * and I can't figure out how to get it back off.
@@ -18,9 +21,13 @@
1922 margin-top: 160px;
2023 }
2124
22 -.rtl #bodyContent a.external {
23 - background-image: url(external-rtl.png);
24 - padding: 0 13px 0 0;
 25+/* These elements also have padding-left: 20px; in main.css, but in RTL mode this is flipped.
 26+ * That's good in normal browsers, but in IE7 it needs to not be flipped for some daft reason.
 27+ * Also clear the right margin (originally margin-left: 1em)
 28+ */
 29+li#pt-userpage, li#pt-anonuserpage, li#pt-login {
 30+ padding-left: 20px;
 31+ margin-right: 0;
2532 }
2633
2734 .rtl a.feedlink {
Index: branches/REL1_18/phase3/skins/CologneBlue.php
@@ -44,7 +44,7 @@
4545 $rules[] = "/* @noflip */body>#quickbar { position: fixed; right: 4px; top: 4px; overflow: auto; bottom:4px;}"; # Hides from IE
4646 }
4747 $style = implode( "\n", $rules );
48 - $out->addInlineStyle( $style, /* flip css if RTL */true );
 48+ $out->addInlineStyle( $style, 'flip' );
4949 }
5050
5151 }
Index: branches/REL1_18/phase3/skins/Standard.php
@@ -27,20 +27,20 @@
2828
2929 if ( 2 == $qb ) { # Right
3030 $rules[] = "/* @noflip */#quickbar { position: absolute; top: 4px; right: 4px; border-left: 2px solid #000000; }";
31 - $rules[] = "/* @noflip */#article, /* @noflip */#mw-data-after-content { margin-left: 4px; margin-right: 152px; }";
 31+ $rules[] = "/* @noflip */#article, #mw-data-after-content { margin-left: 4px; margin-right: 152px; }";
3232 } elseif ( 1 == $qb || 3 == $qb ) {
3333 $rules[] = "/* @noflip */#quickbar { position: absolute; top: 4px; left: 4px; border-right: 1px solid gray; }";
34 - $rules[] = "/* @noflip */#article, /* @noflip */#mw-data-after-content { margin-left: 152px; margin-right: 4px; }";
 34+ $rules[] = "/* @noflip */#article, #mw-data-after-content { margin-left: 152px; margin-right: 4px; }";
3535 if( 3 == $qb ) {
3636 $rules[] = "/* @noflip */#quickbar { position: fixed; padding: 4px; }";
3737 }
3838 } elseif ( 4 == $qb ) {
3939 $rules[] = "/* @noflip */#quickbar { position: fixed; right: 0px; top: 0px; padding: 4px;}";
4040 $rules[] = "/* @noflip */#quickbar { border-right: 1px solid gray; }";
41 - $rules[] = "/* @noflip */#article, /* @noflip */#mw-data-after-content { margin-right: 152px; margin-left: 4px; }";
 41+ $rules[] = "/* @noflip */#article, #mw-data-after-content { margin-right: 152px; margin-left: 4px; }";
4242 }
4343 $style = implode( "\n", $rules );
44 - $out->addInlineStyle( $style, /* flip css if RTL */true );
 44+ $out->addInlineStyle( $style, 'flip' );
4545 }
4646
4747 }
Index: branches/REL1_18/phase3/skins/common/shared.css
@@ -732,6 +732,13 @@
733733 margin: 0 2em 0 0;
734734 }
735735
 736+#toc #toctitle,
 737+.toc #toctitle,
 738+#toc .toctitle,
 739+.toc .toctitle {
 740+ direction: ltr;
 741+}
 742+
736743 /* tooltip styles */
737744 .mw-help-field-hint {
738745 display: none;
Index: branches/REL1_18/phase3/skins/MonoBook.php
@@ -36,10 +36,10 @@
3737 }
3838
3939 // TODO: Migrate all of these
40 - //$out->addStyle( 'monobook/IE50Fixes.css', 'screen', 'lt IE 5.5000' );
41 - //$out->addStyle( 'monobook/IE55Fixes.css', 'screen', 'IE 5.5000' );
42 - //$out->addStyle( 'monobook/IE60Fixes.css', 'screen', 'IE 6' );
43 - //$out->addStyle( 'monobook/IE70Fixes.css', 'screen', 'IE 7' );
 40+ $out->addStyle( 'monobook/IE50Fixes.css', 'screen', 'lt IE 5.5000' );
 41+ $out->addStyle( 'monobook/IE55Fixes.css', 'screen', 'IE 5.5000' );
 42+ $out->addStyle( 'monobook/IE60Fixes.css', 'screen', 'IE 6' );
 43+ $out->addStyle( 'monobook/IE70Fixes.css', 'screen', 'IE 7' );
4444
4545 }
4646 }
Index: branches/REL1_18/phase3/RELEASE-NOTES-1.18
@@ -202,14 +202,8 @@
203203 * Introduced $wgVaryOnXFPForAPI which will cause the API to send
204204 Vary: X-Forwarded-Proto headers.
205205 * New maintenance script to refresh image metadata (maintenance/refreshImageMetadata.php)
206 -* (bug 16428) Include permalink in printable version
207 -* (bug 30940) Add a hook in User:getDefaultOptions.
208 - To give extensions a better and more flexible way of providing default
209 - values for preferences a hook has been introdiced in User:getDefaultOptions().
210 - Setting preferences in $wgDefaultUserOptions still work fine, but when reading
211 - them (i.e. with array_keys) to get a list of all preferences, then
212 - $wgDefaultUserOptions should no longer be used as it will contain those set via
213 - User:getDefaultOptions().
 206+* (bug 30722) Add an identity collation that sorts things based on what the
 207+ unicode code point is (aka pre-1.17 behaviour)
214208
215209 === Bug fixes in 1.18 ===
216210 * mw.util.getScript has been implemented (like wfScript in GlobalFunctions.php)
Property changes on: branches/REL1_18/phase3/RELEASE-NOTES-1.18
___________________________________________________________________
Modified: svn:mergeinfo
217211 Merged /trunk/phase3/RELEASE-NOTES-1.18:r96760,96765,96810,97551-97552,97575,97607-97608,97622-97623,97625,97634
Index: branches/REL1_18/phase3/includes/profiler/Profiler.php
@@ -13,7 +13,7 @@
1414 */
1515 function wfProfileIn( $functionname ) {
1616 global $wgProfiler;
17 - if ( isset( $wgProfiler['class'] ) ) {
 17+ if ( $wgProfiler instanceof Profiler || isset( $wgProfiler['class'] ) ) {
1818 Profiler::instance()->profileIn( $functionname );
1919 }
2020 }
@@ -24,7 +24,7 @@
2525 */
2626 function wfProfileOut( $functionname = 'missing' ) {
2727 global $wgProfiler;
28 - if ( isset( $wgProfiler['class'] ) ) {
 28+ if ( $wgProfiler instanceof Profiler || isset( $wgProfiler['class'] ) ) {
2929 Profiler::instance()->profileOut( $functionname );
3030 }
3131 }
Index: branches/REL1_18/phase3/includes/OutputPage.php
@@ -2902,10 +2902,10 @@
29032903 /**
29042904 * Adds inline CSS styles
29052905 * @param $style_css Mixed: inline CSS
2906 - * @param $flip Boolean: Whether to flip the CSS if needed
 2906+ * @param $flip False or String: Set to 'flip' to flip the CSS if needed
29072907 */
29082908 public function addInlineStyle( $style_css, $flip = false ) {
2909 - if( $flip && $this->getLang()->isRTL() ) {
 2909+ if( $flip === 'flip' && $this->getLang()->isRTL() ) {
29102910 # If wanted, and the interface is right-to-left, flip the CSS
29112911 $style_css = CSSJanus::transform( $style_css, true, false );
29122912 }
Property changes on: branches/REL1_18/phase3/includes/OutputPage.php
___________________________________________________________________
Modified: svn:mergeinfo
29132913 Merged /trunk/phase3/includes/OutputPage.php:r96760,96765,96810,97551-97552,97575,97607-97608,97622-97623,97625,97634
Index: branches/REL1_18/phase3/includes/installer/MysqlUpdater.php
@@ -162,7 +162,6 @@
163163
164164 // 1.17
165165 array( 'addTable', 'iwlinks', 'patch-iwlinks.sql' ),
166 - array( 'addTable', 'user_former_groups', 'patch-user_former_groups.sql'),
167166 array( 'addIndex', 'iwlinks', 'iwl_prefix_title_from', 'patch-rename-iwl_prefix.sql' ),
168167 array( 'addField', 'updatelog', 'ul_value', 'patch-ul_value.sql' ),
169168 array( 'addField', 'interwiki', 'iw_api', 'patch-iw_api_and_wikiid.sql' ),
@@ -181,7 +180,8 @@
182181 array( 'doUserNewTalkTimestampNotNull' ),
183182 array( 'addIndex', 'user', 'user_email', 'patch-user_email_index.sql' ),
184183 array( 'modifyField', 'user_properties', 'up_property', 'patch-up_property.sql' ),
185 - array( 'addTable', 'uploadstash', 'patch-uploadstash.sql' ),
 184+ array( 'addTable', 'uploadstash', 'patch-uploadstash.sql' ),
 185+ array( 'addTable', 'user_former_groups', 'patch-user_former_groups.sql'),
186186 );
187187 }
188188
Index: branches/REL1_18/phase3/includes/installer/SqliteUpdater.php
@@ -42,8 +42,7 @@
4343 array( 'sqliteSetupSearchindex' ),
4444
4545 // 1.17
46 - array( 'addTable', 'iwlinks', 'patch-iwlinks.sql' ),
47 - array( 'addTable', 'user_former_groups', 'patch-user_former_groups.sql'),
 46+ array( 'addTable', 'user_former_groups', 'patch-user_former_groups.sql'),
4847 array( 'addIndex', 'iwlinks', 'iwl_prefix_title_from', 'patch-rename-iwl_prefix.sql' ),
4948 array( 'addField', 'updatelog', 'ul_value', 'patch-ul_value.sql' ),
5049 array( 'addField', 'interwiki', 'iw_api', 'patch-iw_api_and_wikiid.sql' ),
@@ -58,7 +57,8 @@
5958
6059 // 1.18
6160 array( 'addIndex', 'user', 'user_email', 'patch-user_email_index.sql' ),
62 - array( 'addTable', 'uploadstash', 'patch-uploadstash.sql' ),
 61+ array( 'addTable', 'uploadstash', 'patch-uploadstash.sql' ),
 62+ array( 'addTable', 'user_former_groups', 'patch-user_former_groups.sql'),
6363 );
6464 }
6565
Index: branches/REL1_18/phase3/includes/resourceloader/ResourceLoaderContext.php
@@ -73,6 +73,8 @@
7474 */
7575 public static function expandModuleNames( $modules ) {
7676 $retval = array();
 77+ // For backwards compatibility with an earlier hack, replace ! with .
 78+ $modules = str_replace( '!', '.', $modules );
7779 $exploded = explode( '|', $modules );
7880 foreach ( $exploded as $group ) {
7981 if ( strpos( $group, ',' ) === false ) {
Index: branches/REL1_18/phase3/includes/AutoLoader.php
@@ -116,6 +116,7 @@
117117 'HttpRequest' => 'includes/HttpFunctions.old.php',
118118 'IContextSource' => 'includes/RequestContext.php',
119119 'IcuCollation' => 'includes/Collation.php',
 120+ 'IdentityCollation' => 'includes/Collation.php',
120121 'ImageGallery' => 'includes/ImageGallery.php',
121122 'ImageHistoryList' => 'includes/ImagePage.php',
122123 'ImageHistoryPseudoPager' => 'includes/ImagePage.php',
Property changes on: branches/REL1_18/phase3/includes/AutoLoader.php
___________________________________________________________________
Modified: svn:mergeinfo
123124 Merged /trunk/phase3/includes/AutoLoader.php:r96760,96765,96810,97551-97552,97575,97607-97608,97622-97623,97625,97634
Index: branches/REL1_18/phase3/includes/Collation.php
@@ -23,6 +23,8 @@
2424 switch( $collationName ) {
2525 case 'uppercase':
2626 return new UppercaseCollation;
 27+ case 'identity':
 28+ return new IdentityCollation;
2729 case 'uca-default':
2830 return new IcuCollation( 'root' );
2931 default:
@@ -99,6 +101,30 @@
100102 }
101103 }
102104
 105+/**
 106+ * Collation class that's essentially a no-op.
 107+ *
 108+ * Does sorting based on binary value of the string.
 109+ * Like how things were pre 1.17.
 110+ */
 111+class IdentityCollation extends Collation {
 112+
 113+ function getSortKey( $string ) {
 114+ return $string;
 115+ }
 116+
 117+ function getFirstLetter( $string ) {
 118+ global $wgContLang;
 119+ // Copied from UppercaseCollation.
 120+ // I'm kind of unclear on when this could happen...
 121+ if ( $string[0] == "\0" ) {
 122+ $string = substr( $string, 1 );
 123+ }
 124+ return $wgContLang->firstChar( $string );
 125+ }
 126+}
 127+
 128+
103129 class IcuCollation extends Collation {
104130 var $primaryCollator, $mainCollator, $locale;
105131 var $firstLetterData;
Index: branches/REL1_18/phase3/includes/DefaultSettings.php
@@ -4796,6 +4796,8 @@
47974797 *
47984798 * - uppercase: Converts the category name to upper case, and sorts by that.
47994799 *
 4800+ * - identity: Does no conversion. Sorts by binary value of the string.
 4801+ *
48004802 * - uca-default: Provides access to the Unicode Collation Algorithm with
48014803 * the default element table. This is a compromise collation which sorts
48024804 * all languages in a mediocre way. However, it is better than "uppercase".
@@ -4809,7 +4811,7 @@
48104812 * the sort keys in the database.
48114813 *
48124814 * Extensions can define there own collations by subclassing Collation
4813 - * and using the class name as the value of this variable.
 4815+ * and using the Collation::factory hook.
48144816 */
48154817 $wgCategoryCollation = 'uppercase';
48164818
Index: branches/REL1_18/phase3/resources/mediawiki/mediawiki.js
@@ -1064,6 +1064,23 @@
10651065 return null;
10661066 };
10671067
 1068+ /**
 1069+ * Get names of all registered modules.
 1070+ *
 1071+ * @return {Array}
 1072+ */
 1073+ this.getModuleNames = function() {
 1074+ var names = $.map( registry, function( i, key ) {
 1075+ return key;
 1076+ } );
 1077+ return names;
 1078+ };
 1079+
 1080+ /**
 1081+ * For backwards-compatibility with Squid-cached pages. Loads mw.user
 1082+ */
 1083+ this.go = function() { mw.loader.load( 'mediawiki.user' ); };
 1084+
10681085 /* Cache document ready status */
10691086
10701087 $(document).ready( function() { ready = true; } );

Follow-up revisions

RevisionCommit summaryAuthorDate
r97674Restore RELEASE-NOTES-1.18 entries accidentally killed in r97673reedy22:38, 20 September 2011
r97677And revert some extra JS from r97673reedy22:42, 20 September 2011
r98580Followup r97673...reedy23:05, 30 September 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r96760* Per Aaron on r96261, use string 'flip' instead of boolean...robin23:51, 10 September 2011
r96765(bug 30722) Add an identity collation that sorts things based on what the uni...bawolff01:13, 11 September 2011
r96810(follow-up r96765). Appearently my release notes for that revision were horri...bawolff20:37, 11 September 2011
r97551Don't try and delete ForeignAPIFile or ForeignDBFile...reedy20:20, 19 September 2011
r97552Followup r97551, use isLocal, more dynamic!reedy20:27, 19 September 2011
r97575Back-compat for $wgProfiler set as a class. Fix for r89206demon23:25, 19 September 2011
r97607Accept ResourceLoader URLs containing '!' in '.' for backwards compatibility ...catrope09:13, 20 September 2011
r97608For backwards compatibility with cached HTML generated by MediaWiki 1.17, re-...catrope09:16, 20 September 2011
r97622As reported in bug 31031, WebKit can mess up the TOC title (which is in user ...robin13:05, 20 September 2011
r97623Reinstate IE*Fixes.css . This fixes most of the breakage from r74966, but the...catrope13:21, 20 September 2011
r97634Followup r97623: some fixes for RTL in IE70Fixes.css:...catrope15:33, 20 September 2011

Comments

#Comment by Bawolff (talk | contribs)   17:56, 30 September 2011

Since this touched the sqlite installer, I'm assuming it's this revision's fault ;)

Error:

DatabaseSqliteTest::testUpgrades
DBQueryError: A database error has occurred.  Did you forget to run maintenance/update.php after upgrading?  See: [http://www.mediawiki.org/wiki/Manual:Upgrading#Run_the_update_script http://www.mediawiki.org/wiki/Manual:Upgrading#Run_the_update_script]
Query: CREATE INDEX IF NOT EXISTS iwl_prefix_from_title ON iwlinks (iwl_prefix, iwl_from, iwl_title)

Function: DatabaseBase::sourceFile( /home/ci/cruisecontrol-bin-2.8.3/projects/REL1_18/source/maintenance/sqlite/archives/patch-rename-iwl_prefix.sql )
Error: 1 no such table: main.iwlinks
#Comment by Reedy (talk | contribs)   18:05, 30 September 2011

I'm away from a computer till later on tonight. Looks like it ate a line on the sqlite updater


Why's it only showing now? :-/

#Comment by Bawolff (talk | contribs)   18:07, 30 September 2011

Cruise control has been shown as being broken since this was committed from what I can tell - Its just no one looks at it for the 1.18 branch :P

#Comment by Reedy (talk | contribs)   18:10, 30 September 2011

Feel free to restore the line

#Comment by Bawolff (talk | contribs)   20:54, 30 September 2011

I can't do that right now, but I should be able to later today.

Note, neither r76765 nor r97235 appear to get merged, but they weren't marked as needing to be merged so that might be ok... And r96765 wasn't tagged for being merged, but got merged anyways, but that won't hurt anything.

#Comment by Reedy (talk | contribs)   23:00, 30 September 2011

As the rev numbers are in numerical order, it's clear r76765 is a typo. Should be r96765, and have updated the followup tags as such.

r97235 is also a typo (I'm only merging phase3, so of course this hasn't been)

r96765 was tagged, see the status changes at the bottom of the revision.

Status & tagging log

23:36, 20 September 2011 Reedy (Talk | contribs | block) changed the tags for [[Special:Code/MediaWiki/96765|r96765]] [removed: 1.18]
18:58, 20 September 2011 Catrope (Talk | contribs | block) changed the tags for [[Special:Code/MediaWiki/96765|r96765]] [added: 1.18]
16:56, 20 September 2011 Catrope (Talk | contribs | block) changed the tags for [[Special:Code/MediaWiki/96765|r96765]] [removed: 1.18wmf1]
12:59, 14 September 2011 Catrope (Talk | contribs | block) changed the tags for [[Special:Code/MediaWiki/96765|r96765]] [removed: 1.18 added: 1.18wmf1]
17:14, 13 September 2011 Nikerabbit (Talk | contribs | block) changed the status of [[Special:Code/MediaWiki/96765|r96765]] [removed: new added: ok]
02:13, 11 September 2011 Bawolff (Talk | contribs | block) changed the tags for [[Special:Code/MediaWiki/96765|r96765]] [added: 1.18]
#Comment by Reedy (talk | contribs)   23:08, 30 September 2011

CruiseControl now fixed. Cheers for the heads up

Status & tagging log