MDL-46991 Availability: Conditional dates not updated on restore

This commit is contained in:
sam marshall 2014-08-29 18:51:18 +01:00
parent 272fec367f
commit 5176504d3f
8 changed files with 158 additions and 55 deletions

View file

@ -606,10 +606,13 @@ class tree extends tree_node {
public function save() {
$result = new \stdClass();
$result->op = $this->op;
if ($this->op === self::OP_AND || $this->op === self::OP_NOT_OR) {
$result->showc = $this->showchildren;
} else {
$result->show = $this->show;
// Only root tree has the 'show' options.
if ($this->root) {
if ($this->op === self::OP_AND || $this->op === self::OP_NOT_OR) {
$result->showc = $this->showchildren;
} else {
$result->show = $this->show;
}
}
$result->c = array();
foreach ($this->children as $child) {