SilverCart Forum

We moderate this Forum and we're here to help. Have you already run a forum search to check if your problem has already been solved?

You can help us helping you by providing detailed error messages, screenshots and logfile entries.

SebastianRamon

Page: 1
Topic [resolved] bug: deleting logged in user in the CMS (Fatal error) 1960 Views

[resolved] bug: deleting logged in user in the CMS (Fatal error)

4 November 2013 at 9:35am Last edited: 16 November 2013 10:09am

Hi,

I know it happens very rarely, but when we delete a customer while she/he is still logged in, that customer trying to perform any user related actions (going to my data, logging out, etc...) will get this fatal error:
Fatal error: Call to a member function isAdmin() on a non-object in /Users/guru/Documents/MAMP/silvercart/requirements_engine/RequirementsEngine.php on line 319

best,
Szabesz

Re: [resolved] bug: deleting logged in user in the CMS (Fatal error)

5 November 2013 at 12:51pm

Hi Szabesz,

thanks for this report, we will check this!

Best Regards
Sebastian

Re: [resolved] bug: deleting logged in user in the CMS (Fatal error)

16 November 2013 at 10:07am Last edited: 16 November 2013 10:08am

Hi Gábor,

thanks for reporting.

This bug actually comes from SilverStripe itself, because Member::currentUserID gives the wrong result, so the check for Member::currentUserID > 0 is passed and leads to an error in the following condition, because there is no member instance.

In order to avoid this, we now also check if currentUser is an instance of the class Member.

This fix will be published with the next SilverCart release next week.

Cheers
Ramon

Re: [resolved] bug: deleting logged in user in the CMS (Fatal error)

16 November 2013 at 10:20am Last edited: 16 November 2013 10:20am

Hi Ramon,

Thank you for the detailed info and the workaround. Nice to know what is going on under the hood.

Cheers
Szabesz