| "Fatal error: Class 'BaseFormPropel' not found" [message #59554] |
Wed, 27 August 2008 16:40  |
dubitable Messages: 3 Registered: August 2008 |
Junior Member |
|
|
Hi folks,
I've been working using symfony locally and have had no problems. But now I'm trying to deploy on GoDaddy and running into some trouble.
I got over the first few hurdles with a bit of assistance from some online sources and the forum archives: I dealt with some path issues relating to the sf directory and tweaked the code in frontend_dev.php so that I could see it remotely, and added some htaccess and php5.ini stuff. MySQL db config proceeded smoothly enough, and I finally got my application to work on one of the module actions. However, the other two module actions involve forms, and it seems that this is where the problem is.
When I go to the module action "answer/create," I get this code dumped to the browser (note that I've changed the path in this code example to protect the innocent):
[?php /** * Project form base class. * * @package form * @version SVN: $Id: sfPropelFormBaseTemplate.php 6174 2007-11-27 06:22:40Z fabien $ */
abstract class BaseFormPropel extends sfFormPropel { public function setup() { } }
Fatal error: Class 'BaseFormPropel' not found in /some/web/path/symfony/lib/form/base/BaseAnswerForm.class.php on line 10
Seems sort of funny 'cause it is clearly dumping out BaseFormPropel...so obviously it is finding it on some level! But I'm a bit stumped at this point. Anyone have any ideas? Is this something to do with GoDaddy, or something I failed to tweak (both...)?
Thank you for any suggestions!
Best,
DD
|
|
|
|
| Re: "Fatal error: Class 'BaseFormPropel' not found" [message #59571 is a reply to message #59554 ] |
Wed, 27 August 2008 18:54   |
halfer Messages: 9535 Registered: January 2006 Location: West Midlands, UK |
Faithful Member |
|
|
The "[?php" is a bit of a warning flag for me. This is a symbol used to describe the template of a class before it is written in a symfony PHP process. Ultimately I think it indicates that there was an error in the Forms build process, so would advise you to do that again (and watch carefully for errors).
Also make sure you do your forms building on your local machine, not on your host (there is no need to do it on your host - just upload the generated files from your local machine).
Remember Palestine
|
|
|
|
| Re: "Fatal error: Class 'BaseFormPropel' not found" [message #59577 is a reply to message #59554 ] |
Wed, 27 August 2008 19:08   |
halfer Messages: 9535 Registered: January 2006 Location: West Midlands, UK |
Faithful Member |
|
|
Try clearing your remote cache manually: delete everything inside your cache folder.
Remember Palestine
|
|
|
|
|
|
|
| Re: "Fatal error: Class 'BaseFormPropel' not found" [message #71889 is a reply to message #59554 ] |
Mon, 09 February 2009 16:50   |
ksloan Messages: 2 Registered: December 2008 |
Junior Member |
|
|
I did solve this problem, still not sure what exactly caused it.
Quick answer:
delete the file
rm lib/symfony/plugins/sfPropelPlugin/data/generator/sfPropelForm/default/template/sfPropelFormBaseTemplate.php
and clear your cache on the command line
Long answer:
Symfony builds a master include class array that seems to tell php where to find class files per application. This file is located at
cache/$app/$env/config/config_autoload.yml.php
Where $evn is production, dev etc (whatever appears after your script name, typically _dev.php when not in production)
You will should be getting 2 lines for BaseFormPropel, and this is the issue. If you swap the two lines, you will see things should work. But your world will come crashing down the next time you clear symfony cache.
I'm not sure what/why there is 2 instances of this same class. I ended up just deleting the php file that was being read out instead of server side ran, and then my app worked, and I haven't had any issues since. Its been about a full month since I've done this.
The 2 files that conflict are
lib/symfony/plugins/sfPropelPlugin/data/generator/sfPropelForm/default/template/sfPropelFormBaseTemplate.php
lib/form/BaseFormPropel.class.php
With the problem one being the one deep in the propel plugin area. If you compare the files, they are the same except for the square brace instead of greater then sign to start out the php statement.
Both of these files seem to be included in symfony 1.1 in the sf_sandbox, and I believe this might just be a bug.
Also of note, I didn't get this problem tell we moved code to a new server, so I still don't really understand why this bad file started getting added to the master class file array.
|
|
|
| Re: "Fatal error: Class 'BaseFormPropel' not found" [message #71892 is a reply to message #71889 ] |
Mon, 09 February 2009 16:56  |
cestcri Messages: 232 Registered: August 2007 Location: Paris |
Faithful Member |
|
|
Thanks for your answer. This bug "allowed me" to explore and understand the autoload feature, so I'm digging everytime deeper into this beautiful framework.
Anyway, I'd say this bug should somehow be treated and removed for the next version, I hope they're already working on it.
In the meanwhile I follow your advice, thanks a million.
Have a nice day,
Christian
|
|
|