r74295 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r74294‎ | r74295 | r74296 >
Date:11:51, 5 October 2010
Author:jeroendedauw
Status:resolved (Comments)
Tags:
Comment:
Changes for 0.4 - fixed issue with handling parameter dependencies
Modified paths:
  • /trunk/extensions/Validator/includes/Validator.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Validator/includes/Validator.php
@@ -299,13 +299,23 @@
300300 }
301301 }
302302
303 - $dependencies = array();
 303+ $dependencyList = array();
304304
 305+ // Loop over the parameters to handle to create a dependency list.
305306 foreach ( $this->paramsTohandle as $paramName ) {
306 - $dependencies[$paramName] = array(); //$this->parameters[$paramName]->getDependencies();
 307+ $dependencies = array();
 308+
 309+ // Only include dependencies that are in the list of parameters to handle.
 310+ foreach ( $this->parameters[$paramName]->getDependencies() as $dependency ) {
 311+ if ( in_array( $dependency, $this->paramsTohandle ) ) {
 312+ $dependencies[] = $dependency;
 313+ }
 314+ }
 315+
 316+ $dependencyList[$paramName] = array();
307317 }
308318
309 - $sorter = new TopologicalSort( $dependencies, true );
 319+ $sorter = new TopologicalSort( $dependencyList, true );
310320
311321 $this->paramsTohandle = $sorter->doSort();
312322 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r74301Follow up to r74295jeroendedauw14:18, 5 October 2010

Comments

#Comment by Brion VIBBER (talk | contribs)   14:56, 5 October 2010

Mistake here '$dependencyList[$paramName] = array();' is resolved by r74301

Status & tagging log