# This patch file was generated by NetBeans IDE
# This patch can be applied using context Tools: Apply Diff Patch action on respective folder.
# It uses platform neutral UTF-8 encoding.
# Above lines and this line are ignored by the patching process.
Index: moodle/lib/db/upgrade.php
--- moodle/lib/db/upgrade.php Base (1.154.2.77)
+++ moodle/lib/db/upgrade.php Locally Modified (Based On 1.154.2.77)
@@ -3345,6 +3345,21 @@
         upgrade_main_savepoint($result, 2007101571.05);
     }
 
+    if ($result && $oldversion < 2007101591) {
+        // Fix the hardcoded use of CONCAT within the log_display table
+        $fullnameconcat = sql_concat('firstname',' ','lastname');
+        upgrade_fix_log_display_concat('user', 'view', 'user', $fullnameconcat);
+        upgrade_fix_log_display_concat('course', 'user report', 'user', $fullnameconcat);
+        upgrade_fix_log_display_concat('message', 'write', 'user', $fullnameconcat);
+        upgrade_fix_log_display_concat('message', 'read', 'user', $fullnameconcat);
+        upgrade_fix_log_display_concat('message', 'add contact', 'user', $fullnameconcat);
+        upgrade_fix_log_display_concat('message', 'remove contact', 'user', $fullnameconcat);
+        upgrade_fix_log_display_concat('message', 'block contact', 'user', $fullnameconcat);
+        upgrade_fix_log_display_concat('message', 'unblock contact', 'user', $fullnameconcat);
+
+        upgrade_main_savepoint($result, 2007101591.00);
+    }
+
     return $result;
 }
 
Index: moodle/lib/db/upgradelib.php
--- moodle/lib/db/upgradelib.php Base (1.9.2.10)
+++ moodle/lib/db/upgradelib.php Locally Modified (Based On 1.9.2.10)
@@ -709,4 +709,13 @@
 
 }
 
+function upgrade_fix_log_display_concat($module, $action, $mtable, $concatfield) {
+    $record = get_record('log_display', 'module', $module, 'action', $action, 'mtable', $mtable);
+    if ($record) {
+        $record->field = $concatfield;
+        update_record('log_display', $record);
+    }
+    return true;
+}
+
 ?>
Index: moodle/version.php
--- moodle/version.php Base (1.563.2.981)
+++ moodle/version.php Locally Modified (Based On 1.563.2.981)
@@ -6,7 +6,7 @@
 // This is compared against the values stored in the database to determine
 // whether upgrades should be performed (see lib/db/*.php)
 
-    $version = 2007101590.00; // YYYYMMDD      = date of the 1.9 branch (don't change)
+    $version = 2007101591.00; // YYYYMMDD      = date of the 1.9 branch (don't change)
                               //         X     = release number 1.9.[0,1,2,3,4,5...]
                               //          Y.YY = micro-increments between releases
 
