@@ -4045,17 +4045,25 @@ function xmldb_core_upgrade($oldversion=0) {
log_debug("Updating TinyMCE emoticon locations in mahara database");
// Seeing as tinymce has moved the location of the emoticons
// we need to fix up a few places where users could have added emoticons.
// $replacements is key = table, value = column
$replacements=array('view'=>'description',
'artefact'=>'title',
'artefact'=>'description',
'group'=>'description',
'interaction_forum_post'=>'body',
'notification_internal_activity'=>'message',
'blocktype_wall_post'=>'text',
'site_content'=>'content');
// $replacements is $value['table'] = table, $value['column'] = column
$replacements=array(array('table'=>'view',
'column'=>'description'),
array('table'=>'artefact',
'column'=>'title'),
array('table'=>'artefact',
'column'=>'description'),
array('table'=>'group',
'column'=>'description'),
array('table'=>'interaction_forum_post',
'column'=>'body'),
array('table'=>'notification_internal_activity',
'column'=>'message'),
array('table'=>'blocktype_wall_post',
'column'=>'text'),
array('table'=>'site_content',
'column'=>'content'));
foreach($replacementsas$key=>$value){
execute_sql("UPDATE {".$key."} SET ".$value." = REPLACE(".$value.", '/emotions/img', '/emoticons/img') WHERE ".$value." LIKE '%/emotions/img%'");
execute_sql("UPDATE {".$value['table']."} SET ".$value['column']." = REPLACE(".$value['column'].", '/emotions/img', '/emoticons/img') WHERE ".$value['column']." LIKE '%/emotions/img%'");
}
// 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 '%/emotions/img%'",array())){
...
...
@@ -4068,7 +4076,7 @@ function xmldb_core_upgrade($oldversion=0) {