MDL-15252 Fixed regression: XMLDB action using optionally defined strings
authorDavid Mudrak <david.mudrak@gmail.com>
Thu, 22 Apr 2010 21:13:53 +0000 (21:13 +0000)
committerDavid Mudrak <david.mudrak@gmail.com>
Thu, 22 Apr 2010 21:13:53 +0000 (21:13 +0000)
To prevent debugging warning, we check if the string is defined first.
In this case it does not make sense to add new string for every action
as the title is not actually displayed anywhere.

admin/xmldb/actions/XMLDBAction.class.php

index 6e75731..c388ced 100644 (file)
@@ -126,7 +126,11 @@ class XMLDBAction {
      */
     function loadStrings($strings) {
     /// Load some commonly used strings
-        $this->str['title'] = get_string($this->title, 'xmldb');
+        if (get_string_manager()->string_exists($this->title, 'xmldb')) {
+            $this->str['title'] = get_string($this->title, 'xmldb');
+        } else {
+            $this->str['title'] = $this->title;
+        }
 
     /// Now process the $strings array loading it in the $str atribute
         if ($strings) {