Index: trunk/extensions/Validator/includes/ParserHook.php |
— | — | @@ -53,7 +53,7 @@ |
54 | 54 | * @since 0.4 |
55 | 55 | */ |
56 | 56 | public function __construct() { |
57 | | - $this->validator = new Validator( $this->getName() ); |
| 57 | + |
58 | 58 | } |
59 | 59 | |
60 | 60 | /** |
— | — | @@ -144,6 +144,8 @@ |
145 | 145 | public function validateAndRender( array $arguments, $parsed ) { |
146 | 146 | global $egValidatorErrorLevel; |
147 | 147 | |
| 148 | + $this->validator = new Validator( $this->getName() ); |
| 149 | + |
148 | 150 | if ( $parsed ) { |
149 | 151 | $this->validator->setParameters( $arguments, $this->getParameterInfo() ); |
150 | 152 | } |
Index: trunk/extensions/Validator/includes/Validator.php |
— | — | @@ -313,7 +313,7 @@ |
314 | 314 | $this->mParameters[$mainName] = array( |
315 | 315 | 'original-value' => $paramData, |
316 | 316 | 'original-name' => $paramName, |
317 | | - ); |
| 317 | + ); |
318 | 318 | } |
319 | 319 | } |
320 | 320 | else { |
— | — | @@ -321,9 +321,9 @@ |
322 | 322 | wfMsgExt( |
323 | 323 | 'validator-error-override-argument', |
324 | 324 | 'parsemag', |
325 | | - $mainName, |
| 325 | + $paramName, |
326 | 326 | $this->mParameters[$mainName]['original-value'], |
327 | | - 'demo new value' // TODO: get new value |
| 327 | + is_array( $paramData ) ? $paramData['original-value'] : $paramData |
328 | 328 | ), |
329 | 329 | 'override' |
330 | 330 | ); |