Index: trunk/extensions/Validator/includes/Validator.php |
— | — | @@ -547,27 +547,16 @@ |
548 | 548 | $hasNoErrors = false; |
549 | 549 | |
550 | 550 | $this->registerError( |
551 | | - 'Demo: List error invamid', |
552 | | - /* TODO |
553 | | - wfMsgExt( |
554 | | - 'validator_error_required_missing', |
555 | | - 'parsemag', |
556 | | - $paramName |
| 551 | + $this->getCriteriaErrorMessage( |
| 552 | + $criteriaName, |
| 553 | + $this->mParameters[$name]['original-name'], |
| 554 | + $this->mParameters[$name]['original-value'], |
| 555 | + $criteriaArgs, |
| 556 | + true |
557 | 557 | ), |
558 | | - */ |
559 | 558 | $criteriaName |
560 | | - ); |
| 559 | + ); |
561 | 560 | |
562 | | - /* |
563 | | - $this->mErrors[] = array( |
564 | | - 'type' => , |
565 | | - 'args' => $criteriaArgs, |
566 | | - 'name' => $this->mParameters[$name]['original-name'], |
567 | | - 'list' => true, |
568 | | - 'value' => $this->mParameters[$name]['original-value'] |
569 | | - ); |
570 | | - */ |
571 | | - |
572 | 561 | if ( !self::$accumulateParameterErrors ) { |
573 | 562 | break; |
574 | 563 | } |
— | — | @@ -635,26 +624,16 @@ |
636 | 625 | $value = $validItems; |
637 | 626 | |
638 | 627 | $this->registerError( |
639 | | - 'Demo: Invalid item in list', |
640 | | - /* TODO |
641 | | - wfMsgExt( |
642 | | - 'validator_error_required_missing', |
643 | | - 'parsemag', |
644 | | - $paramName |
| 628 | + $this->getCriteriaErrorMessage( |
| 629 | + $criteriaName, |
| 630 | + $this->mParameters[$name]['original-name'], |
| 631 | + $this->mParameters[$name]['original-value'], |
| 632 | + $criteriaArgs, |
| 633 | + true, |
| 634 | + $invalidItems |
645 | 635 | ), |
646 | | - */ |
647 | 636 | $criteriaName |
648 | | - ); |
649 | | - |
650 | | - /* |
651 | | - $this->mErrors[] = array( |
652 | | - 'type' => $criteriaName, |
653 | | - 'args' => $criteriaArgs, |
654 | | - 'name' => $this->mParameters[$name]['original-name'], |
655 | | - 'list' => true, |
656 | | - 'invalid-items' => $invalidItems |
657 | | - ); |
658 | | - */ |
| 637 | + ); |
659 | 638 | } |
660 | 639 | } |
661 | 640 | } |
— | — | @@ -666,26 +645,15 @@ |
667 | 646 | // Add a new error when the validation failed, and break the loop if errors for one parameter should not be accumulated. |
668 | 647 | if ( !$isValid ) { |
669 | 648 | $this->registerError( |
670 | | - 'Demo: parameter validation failed', |
671 | | - /* TODO |
672 | | - wfMsgExt( |
673 | | - 'validator_error_required_missing', |
674 | | - 'parsemag', |
675 | | - $paramName |
| 649 | + $this->getCriteriaErrorMessage( |
| 650 | + $criteriaName, |
| 651 | + $this->mParameters[$name]['original-name'], |
| 652 | + $this->mParameters[$name]['original-value'], |
| 653 | + $criteriaArgs, |
| 654 | + is_array( $value ) |
676 | 655 | ), |
677 | | - */ |
678 | 656 | $criteriaName |
679 | | - ); |
680 | | - |
681 | | - /* |
682 | | - $this->mErrors[] = array( |
683 | | - 'type' => $criteriaName, |
684 | | - 'args' => $criteriaArgs, |
685 | | - 'name' => $this->mParameters[$name]['original-name'], |
686 | | - 'list' => is_array( $value ), |
687 | | - 'value' => $this->mParameters[$name]['original-value'] |
688 | | - ); |
689 | | - */ |
| 657 | + ); |
690 | 658 | |
691 | 659 | $hasNoErrors = false; |
692 | 660 | if ( !self::$accumulateParameterErrors ) break; |