~ubuntu-branches/ubuntu/trusty/moodle/trusty-proposed

« back to all changes in this revision

Viewing changes to mod/scorm/db/upgrade.php

  • Committer: Package Import Robot
  • Author(s): Thijs Kinkhorst
  • Date: 2013-09-09 15:22:35 UTC
  • mfrom: (1.1.11)
  • Revision ID: package-import@ubuntu.com-20130909152235-d9njbvgugzm380an
Tags: 2.5.2-1
* New upstream version: 2.5.2.
  - Incorporates S3 security patch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
77
77
 
78
78
 
79
79
    // Moodle v2.4.0 release upgrade line
80
 
    // Put any upgrade step following this
81
 
 
 
80
    // Put any upgrade step following this.
82
81
 
83
82
    // Moodle v2.5.0 release upgrade line.
84
83
    // Put any upgrade step following this.
85
84
 
 
85
    // Fix AICC parent/child relationships (MDL-37394).
 
86
    if ($oldversion < 2013050101) {
 
87
        // Get all AICC packages.
 
88
        $aiccpackages = $DB->get_recordset('scorm', array('version' => 'AICC'), '', 'id');
 
89
        foreach ($aiccpackages as $aicc) {
 
90
            $sql = "UPDATE {scorm_scoes}
 
91
                       SET parent = organization
 
92
                     WHERE scorm = ?
 
93
                       AND " . $DB->sql_isempty('scorm_scoes', 'manifest', false, false) . "
 
94
                       AND " . $DB->sql_isnotempty('scorm_scoes', 'organization', false, false) . "
 
95
                       AND parent = '/'";
 
96
            $DB->execute($sql, array($aicc->id));
 
97
        }
 
98
        $aiccpackages->close();
 
99
        upgrade_mod_savepoint(true, 2013050101, 'scorm');
 
100
    }
86
101
 
87
102
    return true;
88
103
}