PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » Database » DB_DataObject_FormBuilder » Bug #2719

requiredRuleMessage not working in new version

Details

Submitted2004-11-08 17:46 UTC
Frompavel dot kunc at beneta dot cz
Assignedjustinpatrin
StatusClosed
PackageDB_DataObject_FormBuilder
PHP Version4.3.3
OSWindows XP Prof.
Roadmaps(Not assigned)

Comments

[2004-11-08 17:46 UTC] pavel dot kunc at beneta dot cz

Description:
------------
I'm using FormBuilder verison 0.10.0, where is a problem with dateElementFormat property. I wanted to upgrade to 0.10.2 where the bug is fixed but I found out that the rule validation in the new version display(when fails) in all situations only 'ruleViolationMessage' even the rule is required type.

The method _addFieldRulesToForm() in DB_DataObject_FormBuilder_QuickForm class doesn't distiguish rule types...

Maybe would help something like:
$sErrorMessage = $rule['validator'] == 'required' ? $this->requiredRuleMessage : $this->ruleViolationMessage;

and then:
$form->addRule($this->getFieldName($fieldName), sprintf($sErrorMessage, $fieldLabel), $rule['validator'],'', $ruleSide);