Commit 80072229 authored by Maria Sorica's avatar Maria Sorica Committed by Cecilia Vela Gurovic

Bug 1734182: Move privacy to site_content_version table

On site update, delete Privacy Statement from the 'site_content'
table and add it to the 'site_content_version' table.

behatnotneeded

Change-Id: Idd765bad0e72165c940e5f6090d3c8861ae8fcd5
parent bec503ce
......@@ -5609,5 +5609,24 @@ function xmldb_core_upgrade($oldversion=0) {
create_table($table);
}
if ($oldversion < 2018010700) {
log_debug('Move the site Privacy statement from the site_content table to the site_content_version table');
if ($records = get_records_array('site_content', 'name', 'privacy')) {
foreach ($records as $data) {
$record = new stdClass;
$record->type = 'privacy';
$record->content = $data->content;
$record->author = $data->mauthor;
$record->institution = $data->institution;
$record->version = '1.0';
$record->ctime = db_format_timestamp(time());
insert_record('site_content_version', $record);
delete_records('site_content', 'id', $data->id);
}
}
}
return $status;
}
......@@ -16,7 +16,7 @@ $config = new stdClass();
// See https://wiki.mahara.org/wiki/Developer_Area/Version_Numbering_Policy
// For upgrades on stable branches, increment the version by one. On master, use the date.
$config->version = 2018010600;
$config->version = 2018010700;
$config->series = '18.04';
$config->release = '18.04dev';
$config->minupgradefrom = 2015030409;
......
Markdown is supported
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