Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When finishing a quiz as anonymous user, I get the following error(s):
- Notice: Undefined property: stdClass::$name in quiz_mail() (line 2455 of /var/www/www.iprhelpdesk.eu/htdocs/sites/all/modules/quiz/quiz.module).
- Notice: Undefined property: stdClass::$language in quiz_mail() (line 2470 of /var/www/www.iprhelpdesk.eu/htdocs/sites/all/modules/quiz/quiz.module).
- Notice: Undefined property: stdClass::$language in quiz_mail() (line 2471 of /var/www/www.iprhelpdesk.eu/htdocs/sites/all/modules/quiz/quiz.module).
This happens when sending the mail to the quiz author, so my quess is that the information is simply not present for an anonymous quiz taker.
Comment | File | Size | Author |
---|---|---|---|
#3 | Undefined_Property_User_Name_Language-1535270-3.patch | 1.32 KB | aadityawalawalkar |
Comments
Comment #1
jeremymilarsky CreditAttribution: jeremymilarsky commentedFollowing. I agree the issue seems to come up when anonymous users are taking a quiz when the module is set to email notifications to the author. (since $user->name and $user->language would be empty with a guest user)
Comment #2
IKN CreditAttribution: IKN commentedFollowing as I'm getting this error, too, although slightly different line #s. Obviously, sending mail to the author is pretty important, so turning it off in order to hide this error is less than desirable. So, far, though, that's what works.
Otherwise, module is working well. Thank you. Note version 7.x-4.0-alpha9
David
Comment #3
aadityawalawalkar CreditAttribution: aadityawalawalkar commentedApply this attached patch to fix the notices after submitting quiz (when anonymous users are taking a quiz)
Comment #3.0
aadityawalawalkar CreditAttribution: aadityawalawalkar commentedtypo in code listing
Comment #4
Sivaji_Ganesh_Jojodae CreditAttribution: Sivaji_Ganesh_Jojodae commentedI'm able to reproduce this issue. Patch looks good to me. However the below line
could be changed to
Duplicate issue #1953600: Undefined Property Error.
Comment #5
djdevinThis issue is being closed because it was filed against a version that is no longer supported. If the issue still persists in the latest version of Quiz, please open a new issue.