I am currently stuck on the error The "default" context does not exist.
when trying to build my data model with the command symfony propel:build --application=frontend --all --and-load --no-confirmation
After lots of Googling it appears this error is caused by using sfContext inside a model or a form so I have found these and commented them out (see below), the error still occurs, does anyone else know a fix?
>> file- /var/www/html/dev/meeting/config/generated-sfGuardPlugin-schema.xml
>> file- /var/www/html/dev/meeting/config/generated-schema.xml
>> propel load data from "/var/www/html/dev/meeting/data/fixtures"
>> propel load data from "/var/www/html/dev/meeting/plugins/sfGuardPlugin/data/fixtures"
The "default" context does not exist.
grep -R sfContext lib/model/*
lib/model/MeetingMeetings.php: return "";//sfContext::getInstance()->getController()->genUrl('meeting/show?id='.$this->getId(), $full);
lib/model/sfGuardUserProfile.php: //if(!is_null(sfContext::getInstance())&&($useYou||$useYourself)&&$this->getUserId()==sfContext::getInstance()->getUser()->getId()) {
grep -R sfContext lib/form/*
lib/form/MeetingMeetingsForm.class.php: //sfContext::getInstance()->getUser()->setFlash("info",
Many thanks for your time,
Not sure what information I can provide, does anyone have any other questions?
I resolved this problem by doing the following.
First find all references to sfContext in your model files and find an alternative way to get what ever sfContext was needed for (for example passing it to the method).
Check all library files mentioned inside any models for use of sfContext, repeat above solution.
Use is_null checks on sfContexts where it has to exist so it only does if it required.
The problem in my case was my save method used another library which used sfContext to get the current user, which obviously doesn't exist when inserting data to the model