You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Form class makes reference to sfGuardUser like so:
$user = sfContext::getInstance()->getUser();
...
if ($schoolId = $user->getGuardUser()->getProfile()->getSchoolId())
The security.yml file for the module is set as follows:
all:
is_secure: true
Clear the symfony cache.
User is logged out and tries to go the module.
Expected result: User is redirected to a login page.
Actual result: 500 error
Fatal error: Call to a member function getProfile() on a non-object in /web/edits_net/editsapp/lib/form/doctrine/sfGuardUserProfileForm.class.php on line 29
If the module is visited once by an authenticated user after the cache is cleared, then subsequent visits by unauthenticated users don't have the problem. Adding a check for isAuthenticated() in the form class prevents the problem.
The text was updated successfully, but these errors were encountered:
Scenario:
$user = sfContext::getInstance()->getUser();
...
if ($schoolId = $user->getGuardUser()->getProfile()->getSchoolId())
all:
is_secure: true
Expected result: User is redirected to a login page.
Actual result: 500 error
Fatal error: Call to a member function getProfile() on a non-object in /web/edits_net/editsapp/lib/form/doctrine/sfGuardUserProfileForm.class.php on line 29
If the module is visited once by an authenticated user after the cache is cleared, then subsequent visits by unauthenticated users don't have the problem. Adding a check for isAuthenticated() in the form class prevents the problem.
The text was updated successfully, but these errors were encountered: