ZF-9343: zf create form failes with "Fatal error: Call to a member function search() on a non-object in library/Zend/Tool/Project/Provider/Form.php on line 70"
Description
{{zf create form}} failes with {{"Fatal error: Call to a member function search() on a non-object in library/Zend/Tool/Project/Provider/Form.php on line 70"}}
cause: formsDirectory resource is not created!
strange: in the default profile formsDirectory is disabled, but there is no enable function
workaround:
add lines marked with '+' in 'library/Zend/Tool/Project/Provider/Form.php'
// determine if testing is enabled in the project $testingEnabled = Zend_Tool_Project_Provider_Test::isTestingEnabled($this->_loadedProfile);
// create forms directory if it doesn't existif (!($formsDirectory = self::_getFormsDirectoryResource($this->_loadedProfile, $moduleName))) {$applicationDirectory = $this->_loadedProfile->search('applicationDirectory');$formsDirectory = $applicationDirectory->createResource('formsDirectory');} if (self::hasResource($this->_loadedProfile, $name, $module)) { throw new Zend_Tool_Project_Provider_Exception('This project already has a form named ' . $name); }
hopefully this helps
Comments
Posted by Ralf Eggert (ralf) on 2010-05-29T08:29:53.000+0000
Cannot reproduce this. When using
zf create form
I am asked to enter the name of the form. Normally the form name should be added like such
zf create form MyForm
Could you please verify if this error still occurs?
Posted by Christopher T. Bradley (criz2oo5) on 2010-08-14T05:01:50.000+0000
Thank you so much! Is there anyway to fix the initial zf create project so it creates a form directory from the start?
Posted by Vinicius Bossle Fagundes (viniciusbossle) on 2010-09-29T12:02:48.000+0000
Please, to reproduce this error the command:
zf create form Login Users
"Fatal error: Call to a member function search() on a non-object in library/Zend/Tool/Project/Provider/Form.php on line 70"
Posted by Ralph Schindler (ralph) on 2010-10-21T09:11:56.000+0000
Use zf enable form (module)
to create that directory.
Fixed in r23207 in trunk and r23208 in release branch 1.11