Commit e113fb45 authored by Nigel McNie's avatar Nigel McNie
Browse files

Removed a couple of unneeded debugging lines from the view migration. Made...

Removed a couple of unneeded debugging lines from the view migration. Made sure to make the block column of the view_artefact table not null after the upgrade, and clear out all the null rows
parent 58eebc9d
......@@ -167,12 +167,10 @@ function upgrade_template_migration() {
}
else if ($view->template == 'PPAE') {
if (!empty($viewcolumns[0]['tpl_label1'])) {
log_debug('tpl_label1 is not empty, assuming it is a wysiwyg and updating its content');
upgrade_template_update_wysiwyg($viewcolumns, 0, 'tpl_label1', null, '<h4>' . $ppae_text[0] . '</h4>' . upgrade_template_get_wysiwyg_content($viewcolumns, 0, 'tpl_label1'));
}
if (!empty($viewcolumns[0]['tpl_label2']) || !empty($viewcolumns[0]['tpl_label3']) || !empty($viewcolumns[0]['tpl_label4']) || !empty($viewcolumns[0]['tpl_label5'])) {
// mash it all into the first one and unset the rest
log_debug('assuming tpl_label2 is a wysiwyg');
$label2_text = '<h4>' . $ppae_text[1] . '</h4>'
. upgrade_template_get_wysiwyg_content($viewcolumns, 0, 'tpl_label2') . '<br>'
. upgrade_template_get_wysiwyg_content($viewcolumns, 0, 'tpl_label3') . '<br>'
......
......@@ -357,8 +357,8 @@ function xmldb_core_upgrade($oldversion=0) {
require_once(get_config('docroot') . 'lib/db/templatemigration.php');
upgrade_template_migration();
// TODO - enable this again
//execute_sql('ALTER TABLE {view_artefact} ALTER block SET NOT NULL');
delete_records_select('view_artefact', 'block IS NULL');
execute_sql('ALTER TABLE {view_artefact} ALTER block SET NOT NULL');
$table = new XMLDBTable('view_artefact');
$field = new XMLDBField('oldblock');
......
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