Undefined property: stdClass::$urlid after doing feedback

Bug #1253462 reported by Robert Lyon
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
Low
Robert Lyon
1.6
Fix Released
Low
Robert Lyon
1.7
Fix Released
Low
Robert Lyon
1.8
Fix Released
Low
Robert Lyon

Bug Description

I set up a new site and created a page as admin user. I added some feedback to page and then when I went to navigate away I got:

[WAR] a0 (lib/user.php:1629) Undefined property: stdClass::$urlid
Call stack (most recent first):

    log_message("Undefined property: stdClass::$urlid", 8, true, true, "/var/www/nyit-testing-mahara/releases/201311202206...", 1629) at /var/www/nyit-testing-mahara/releases/20131120220631/lib/errors.php:430
    error(8, "Undefined property: stdClass::$urlid", "/var/www/nyit-testing-mahara/releases/201311202206...", 1629, array(size 5)) at /var/www/nyit-testing-mahara/releases/20131120220631/lib/user.php:1629
    profile_url("2") at /var/www/nyit-testing-mahara/releases/20131120220631/artefact/comment/lib.php:538
    ArtefactTypeComment::build_html(object(stdClass)) at /var/www/nyit-testing-mahara/releases/20131120220631/artefact/comment/lib.php:383
    ArtefactTypeComment::get_comments(10, 0, "last", object(View), null) at /var/www/nyit-testing-mahara/releases/20131120220631/artefact/comment/lib.php:1152
    add_feedback_form_submit(object(Pieform), array(size 5)) at Unknown:0

from what I could tell from the code the profile_url() call was fetching info about $user and that information was being called from get_user_for_display() and it was returning the $usercache info for the user but the $usercache did not have anything set for urlid

Revision history for this message
Aaron Wells (u-aaronw) wrote :

I noticed a warning message about "Undefined property: stdClass:$urlid" while creating a new group in similar circumstances.

I bet this is related to that recent bug about copied pages not properly getting their urlid filled in.

Revision history for this message
Aaron Wells (u-aaronw) wrote :

Actually I can't replicate the group-creation warning message I thought I was seeing. I was testing some things relating to feedback at the same time, so perhaps I was actually seeing this error message.

I thought it might be related to Bug 1058416, but reverting to before the patch for that bug I still get the issue, so it seems to be unrelated after all.

Revision history for this message
Aaron Wells (u-aaronw) wrote :

Ah, this bug only happens if you have $cfg->cleanurls = true;, and only for the admin user. It's because the admin user's urlid doesn't get created at installation time. Instead of going through create_user(), the admin is created by direct DB insert.

tags: added: bite-sized cleanurls
Changed in mahara:
importance: Undecided → Low
Revision history for this message
Robert Lyon (robertl-9) wrote :

Have added a patch for this
https://reviews.mahara.org/#/c/2726

Changed in mahara:
assignee: nobody → Robert Lyon (robertl-9)
status: New → In Progress
milestone: none → 1.9.0
Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/2726
Committed: http://gitorious.org/mahara/mahara/commit/8bd31fc7fa5ff6cde9662951865d11b3559b5da2
Submitter: Son Nguyen (<email address hidden>)
Branch: master

commit 8bd31fc7fa5ff6cde9662951865d11b3559b5da2
Author: Robert Lyon <email address hidden>
Date: Thu Nov 21 11:51:37 2013 +1300

Checking for $user->urlid before trying to access it (bug #1253462)

In some cases the $user->urlid may not be present - this checks for it
before accessing it otherwise it falls back to the $id to get info

Change-Id: I989e68321402f458b167879e994150213c3e4893
Signed-off-by: Robert Lyon <email address hidden>

Robert Lyon (robertl-9)
Changed in mahara:
status: In Progress → Fix Committed
Revision history for this message
Robert Lyon (robertl-9) wrote :
Revision history for this message
Mahara Bot (dev-mahara) wrote :

Reviewed: https://reviews.mahara.org/2840
Committed: http://gitorious.org/mahara/mahara/commit/c74950702dcab7506acbb8102e4d5697261ef9ff
Submitter: Son Nguyen (<email address hidden>)
Branch: 1.8_STABLE

commit c74950702dcab7506acbb8102e4d5697261ef9ff
Author: Robert Lyon <email address hidden>
Date: Thu Nov 21 11:51:37 2013 +1300

Checking for $user->urlid before trying to access it (bug #1253462)

In some cases the $user->urlid may not be present - this checks for it
before accessing it otherwise it falls back to the $id to get info

Change-Id: I989e68321402f458b167879e994150213c3e4893
Signed-off-by: Robert Lyon <email address hidden>

Revision history for this message
Mahara Bot (dev-mahara) wrote :

Reviewed: https://reviews.mahara.org/2841
Committed: http://gitorious.org/mahara/mahara/commit/70cc2e13bbf24a3c122e2200bb10f82460606316
Submitter: Son Nguyen (<email address hidden>)
Branch: 1.7_STABLE

commit 70cc2e13bbf24a3c122e2200bb10f82460606316
Author: Robert Lyon <email address hidden>
Date: Thu Nov 21 11:51:37 2013 +1300

Checking for $user->urlid before trying to access it (bug #1253462)

In some cases the $user->urlid may not be present - this checks for it
before accessing it otherwise it falls back to the $id to get info

Change-Id: I989e68321402f458b167879e994150213c3e4893
Signed-off-by: Robert Lyon <email address hidden>

Revision history for this message
Mahara Bot (dev-mahara) wrote :

Reviewed: https://reviews.mahara.org/2842
Committed: http://gitorious.org/mahara/mahara/commit/ff9142fc5e001d878ad797498206e3469a04548d
Submitter: Son Nguyen (<email address hidden>)
Branch: 1.6_STABLE

commit ff9142fc5e001d878ad797498206e3469a04548d
Author: Robert Lyon <email address hidden>
Date: Thu Nov 21 11:51:37 2013 +1300

Checking for $user->urlid before trying to access it (bug #1253462)

In some cases the $user->urlid may not be present - this checks for it
before accessing it otherwise it falls back to the $id to get info

Change-Id: I989e68321402f458b167879e994150213c3e4893
Signed-off-by: Robert Lyon <email address hidden>

Robert Lyon (robertl-9)
Changed in mahara:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers