Im upgrading from 1.8.3+ to 1.9 Beta 3, but whenever I do the upgrade I can view course pages, and no all category pages will load. With debug info on, I get a ton of these:
Context id xxx does not have valid path, please use build_context_path()
Ok, that doesn't kill anything, but then it tries to do a SQL where it users the context path in a 'IN ()' statement, which of course fails, like:
SELECT ctx.path, ctx.instanceid, ctx.contextlevel, ra.hidden, r.id AS roleid, r.name as rolename, u.id AS userid, u.firstname, u.lastname FROM mdl_role_assignments ra JOIN mdl_context ctx ON ra.contextid = ctx.id JOIN mdl_user u ON ra.userid = u.id JOIN mdl_role r ON ra.roleid = r.id LEFT OUTER JOIN mdl_course c ON (ctx.instanceid=c.id AND ctx.contextlevel=50) WHERE ( c.id IS NOT NULL OR ra.contextid IN () ) AND ra.roleid IN (3) AND c.category = 123 ORDER BY r.sortorder ASC, ctx.contextlevel ASC, ra.sortorder ASC
or
SELECT MIN(visible) FROM mdl_course_categories WHERE id IN ()
If I run:
SELECT c.id,c.category,c.sortorder,c.shortname,c.fullname,c.idnumber,c.teacher,c.teachers,c.student,c.students,c.guest,c.startdate,c.visible,c.newsitems,c.cost,c.enrol,c.groupmode,c.groupmodeforce,c.password,c.summary,c.currency, ctx.id AS ctxid, ctx.path AS ctxpath, ctx.depth AS ctxdepth, ctx.contextlevel AS ctxlevel FROM mdl_course c JOIN mdl_context ctx ON (c.id=ctx.instanceid AND ctx.contextlevel=50) WHERE c.id != 1 AND c.category = 123 ORDER BY ctxpath ASC
All the courses have no ctxpath.
Any ideas?
Thanks
-eric
Oh yeah, I found something similar at:
http://moodle.org/mod/forum/discuss.php?d=80546
But it doesn't mention a MDL number, so I can't check what it was, maybe we regressed?
-eric
http://moodle.org/mod/forum/discuss.php?d=80546
But it doesn't mention a MDL number, so I can't check what it was, maybe we regressed?
-eric
Hi Eric,
could you please, add one report to the Tracker, with all the details (versions, DB...) upgrade process, course/categories... also, include a link back to this discussion.
That way, some developer will try to reproduce the problem and, if found, fix it ASAP.
TIA and ciao
could you please, add one report to the Tracker, with all the details (versions, DB...) upgrade process, course/categories... also, include a link back to this discussion.
That way, some developer will try to reproduce the problem and, if found, fix it ASAP.
TIA and ciao
Yeah, I was just seeing if anybody knew what it was (like martin), since something very similar had come up already.
-eric
-eric
FIXED IT!!
Im working a ticket, but long story short:
During the upgrade top level course categories get assigned a depth of 0. This is not valid, it should be 1. This means that build_context_path() can't find a valid path through to a top level course categories.
All I had to do is assign a depth of 1 to my top level categories, and the build_context_path() worked like a charm and my entire site works again.
Ill make a ticket shortly. Im trying to best distill the problem.
-Eric
Im working a ticket, but long story short:
During the upgrade top level course categories get assigned a depth of 0. This is not valid, it should be 1. This means that build_context_path() can't find a valid path through to a top level course categories.
All I had to do is assign a depth of 1 to my top level categories, and the build_context_path() worked like a charm and my entire site works again.
Ill make a ticket shortly. Im trying to best distill the problem.
-Eric
Hi Eric,
thanks a lot for being so proactive!
Bug in the tracker is, as you said: MDL-12585
(it seems that you have discovered another bug in your previous post, with the bug not being automatically linked)
Ciao
thanks a lot for being so proactive!
Bug in the tracker is, as you said: MDL-12585
(it seems that you have discovered another bug in your previous post, with the bug not being automatically linked)
Ciao
I was confused about that. I thought MDL- numbers were supposed to be auto linked. I even looked around to make sure I had the format right. Huh.
-eric
-eric
Thanks to Petr, this is patched in 19_STABLE and HEAD.
Thanks all!
-eric
Thanks all!
-eric