mirror of
https://github.com/moodle/moodle.git
synced 2025-04-16 22:15:24 +02:00
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:
parent
ed9f9947e8
commit
5ca9e32d97
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user