http://www.mediawiki.org/wiki/Special:Code/MediaWiki/100323
Revision: 100323
Author: reedy
Date: 2011-10-20 02:13:19 +0000 (Thu, 20 Oct 2011)
Log Message:
-----------
Forwards merge r100173 (fixes for php 5.2) after rebranch
Modified Paths:
--------------
branches/wmf/1.18wmf1/extensions/Contest/api/ApiContestQuery.php
branches/wmf/1.18wmf1/extensions/Contest/test/ContestValidationTests.php
Modified: branches/wmf/1.18wmf1/extensions/Contest/api/ApiContestQuery.php
===================================================================
--- branches/wmf/1.18wmf1/extensions/Contest/api/ApiContestQuery.php
2011-10-20 02:07:57 UTC (rev 100322)
+++ branches/wmf/1.18wmf1/extensions/Contest/api/ApiContestQuery.php
2011-10-20 02:13:19 UTC (rev 100323)
@@ -40,7 +40,11 @@
protected function getClass() {
$className = $this->getClassInfo();
$className = $className['class'];
- return $className::s();
+ static $classes = array();
+ if ( !isset( $classes[$className] ) ) {
+ $classes[$className] = new $className( array() );
+ }
+ return $classes[$className];
}
/**
Modified:
branches/wmf/1.18wmf1/extensions/Contest/test/ContestValidationTests.php
===================================================================
--- branches/wmf/1.18wmf1/extensions/Contest/test/ContestValidationTests.php
2011-10-20 02:07:57 UTC (rev 100322)
+++ branches/wmf/1.18wmf1/extensions/Contest/test/ContestValidationTests.php
2011-10-20 02:13:19 UTC (rev 100323)
@@ -50,7 +50,7 @@
$classes = array( 'Contest', 'ContestChallenge' );
foreach ( $classes as $class ) {
- $this->assertEquals( count( $class::s()->select() ),
$class::s()->count() );
+ // $this->assertEquals( count( $class::s()->select() ),
$class::s()->count() );
}
}
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs