Testing and QA

 
 
Picture of Eric Merrill
Problem with context paths in 1.9
Group Developers
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
 
Average of ratings: -
Picture of Eric Merrill
Re: Problem with context paths in 1.9
Group Developers
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
 
Average of ratings: -
One poor developer...
Re: Problem with context paths in 1.9
Group DevelopersGroup Documentation writersGroup Moodle HQGroup Particularly helpful MoodlersGroup Testers
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. Yes

That way, some developer will try to reproduce the problem and, if found, fix it ASAP. cool

TIA and ciao smile
 
Average of ratings: -
Picture of Eric Merrill
Re: Problem with context paths in 1.9
Group Developers
Yeah, I was just seeing if anybody knew what it was (like martin), since something very similar had come up already.

-eric
 
Average of ratings: -
Picture of Eric Merrill
Re: Problem with context paths in 1.9
Group Developers
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
 
Average of ratings:Useful (1)
Picture of Eric Merrill
Re: Problem with context paths in 1.9
 
Average of ratings: -
One poor developer...
Re: Problem with context paths in 1.9
Group DevelopersGroup Documentation writersGroup Moodle HQGroup Particularly helpful MoodlersGroup Testers
Hi Eric,

thanks a lot for being so proactive! cool

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) big grin

Ciao smile
 
Average of ratings: -
Picture of Eric Merrill
Re: Problem with context paths in 1.9
Group Developers
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
 
Average of ratings: -
Tim at Lone Pine Koala Sanctuary
Re: Problem with context paths in 1.9
Group DevelopersGroup Documentation writersGroup Particularly helpful Moodlers
The bug seems to be that MDL numbers are not hyperlinked if they are the first thing on a line. This will work: MDL-1234

MDL-1234, however, will not.
 
Average of ratings: -
One poor developer...
Re: Problem with context paths in 1.9
Group DevelopersGroup Documentation writersGroup Moodle HQGroup Particularly helpful MoodlersGroup Testers
Fixed the linking bug: MDLSITE-314 wink

Ciao smile
 
Average of ratings: -
Picture of Eric Merrill
Re: Problem with context paths in 1.9
Group Developers
Thanks to Petr, this is patched in 19_STABLE and HEAD.

Thanks all!

-eric
 
Average of ratings: -