MDL-13010

Now correctly checks for category context id and does not fail if it isn't there.

Merged from STABLE_19
This commit is contained in:
thepurpleblob 2008-07-03 14:50:30 +00:00
parent ed9f9947e8
commit 5ca9e32d97

View File

@ -359,7 +359,10 @@ class qformat_default {
$catnames = explode($delimiter, $catpath);
$parent = 0;
$category = null;
if (FALSE !== preg_match('/^\$([a-z]+)\$$/', $catnames[0], $matches)){
// check for context id in path, it might not be there in pre 1.9 exports
$matchcount = preg_match('/^\$([a-z]+)\$$/', $catnames[0], $matches);
if ($matchcount==1) {
$contextid = $this->translator->string_to_context($matches[1]);
array_shift($catnames);
} else {