Commit ffb17c11 authored by Aaron Wells's avatar Aaron Wells
Browse files

Revert "Updating some hardcoded info in database for artefact.php (Bug #1414862)"

This reverts commit 63896cc8.

It's no longer necessary to update these URLs, because
commit 0de9fa76 makes the old-style URLs redirect to the
new-style URLs. And since this rewrite will be a lengthy
operation on large sites, and could potentially cause
problems with URLs for other domain names that happen to
contain "view/artefact.php", we should just remove this
upgrade section.

Change-Id: Ic981f739d6ac5e76efe8116531fc365947ebf286
parent 3f6c7f80
......@@ -3926,35 +3926,6 @@ function xmldb_core_upgrade($oldversion=0) {
}
}
if ($oldversion < 2015012700) {
// Seen as we moved the view/artefact.php file to artefact/artefact.php
// we need to fix upa a few places where users could have hardcoded the url into their data.
// $replacements is key = table, value = column
$replacements = array('view' => 'description',
'artefact' => 'description',
'group' => 'description',
'interaction_forum_post' => 'body',
'notification_internal_activity' => 'message',
'notification_internal_activity' => 'url');
foreach ($replacements as $key => $value) {
execute_sql("UPDATE {" . $key . "} SET " . $value . " = REPLACE(" . $value . ", 'view/artefact.php', 'artefact/artefact.php') WHERE " . $value . " LIKE '%view/artefact.php%'");
}
// we need to handle block_instance configdata in a special way
if ($results = get_records_sql_array("SELECT id FROM {block_instance} WHERE configdata LIKE '%view/artefact.php%'", array())) {
require_once(get_config('docroot') . 'blocktype/lib.php');
foreach ($results as $result) {
$bi = new BlockInstance($result->id);
$configdata = $bi->get('configdata');
foreach ($configdata as $key => $value) {
$configdata[$key] = preg_replace('/view\/artefact.php/', 'artefact/artefact.php', $value);
}
$bi->set('configdata', $configdata);
$bi->commit();
}
}
}
if ($oldversion < 2015013000) {
// Add a sortorder column to blocktype_installed_category
$table = new XMLDBTable('blocktype_installed_category');
......
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