PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » HTML » HTML_QuickForm » Bug #747

setDatasource defaults error

Details

Submitted2004-02-13 07:25 UTC
Fromhlarue at siegewerks dot com
Assignedmansion
StatusClosed
PackageHTML_QuickForm
PHP VersionIrrelevant
OSANY
Roadmaps(Not assigned)

Comments

[2004-02-13 07:25 UTC] hlarue at siegewerks dot com

Description:
------------
setDatasource tries to run non-existent function $this->setDefaultValues. Should read setDefaults.

Reproduce code:
---------------
if (is_callable(array($datasource, 'defaultValues'))) {
$this->setDefaultValues($datasource->defaultValues($this), $defaultsFilter);
}

[2004-02-13 11:35 UTC] mansion at php dot net

Thanks for noticing.
The method is in CVS only at the moment and I m not sure yet if it will be kept for the next releases.

Let me know if you would find it useful.

[2004-02-13 21:24 UTC] hlarue at siegewerks dot com

Yes, these new additions are very useful; please retain them! I'd previously extended the QuickFormController_Page (as DataPage) class to include internal references to $_do (DataObject) and $_fb (FormBuilder). With QuickForm's integrated (and thankfully generic) $_datasource, I can have cleaner code, while adding a more standard defaultValues() and constantValues() to my DataObjects as needed. I've even added a $_datasource to my custom Controller class, now DataController.

[2004-02-23 07:25 UTC] hlarue at siegewerks dot com

Still not fixed in latest update. Have to keep applying the fix myself. Again, I urge you to keep this new feature; a great and simply useful general feature.

[2004-02-23 09:33 UTC] mansion at php dot net

This bug has been fixed in CVS.

In case this was a documentation problem, the fix will show up at the
end of next Sunday (CET) on pear.php.net.

In case this was a pear.php.net website problem, the change will show
up on the website in short time.

Thank you for the report, and for helping us make PEAR better.

OK, the method will be kept, they might become useful when a Builder is implemented too.