Commit 30891a61 authored by Robert Lyon's avatar Robert Lyon
Browse files

Making sure artefacts are locked for submitted views (Bug #1281787)



This can be a problem for older sites.

Should update any that are not locked but should be and do nothing if
all is fine.

Change-Id: Ie5fd71ab76b24009450987681a4800ccc3a8f496
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent 679b5911
......@@ -3129,5 +3129,20 @@ function xmldb_core_upgrade($oldversion=0) {
}
}
if ($oldversion < 2014022400) {
// Make sure artefacts are properly locked for submitted views.
// Can be a problem for older sites
$submitted = get_records_sql_array("SELECT v.owner FROM {view_artefact} va
LEFT JOIN {view} v on v.id = va.view
LEFT JOIN {artefact} a on a.id = va.artefact
WHERE (v.submittedgroup IS NOT NULL OR v.submittedhost IS NOT NULL)", array());
if ($submitted) {
require_once(get_config('docroot') . 'artefact/lib.php');
foreach ($submitted as $record) {
ArtefactType::update_locked($record->owner);
}
}
}
return $status;
}
......@@ -15,7 +15,7 @@ $config = new stdClass();
// See https://wiki.mahara.org/index.php/Developer_Area/Version_Numbering_Policy
// For upgrades on stable branches, increment the version by one. On master, use the date.
$config->version = 2014021200;
$config->version = 2014022400;
$config->release = '1.9.0dev';
$config->minupgradefrom = 2009022600;
$config->minupgraderelease = '1.1.0 (release tag 1.1.0_RELEASE)';
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment