MDL-53170 search: API fixes for core subsystems
authorDavid Monllao <davidm@moodle.com>
Tue, 26 Apr 2016 07:10:54 +0000 (15:10 +0800)
committerDavid Monllao <davidm@moodle.com>
Tue, 10 May 2016 10:15:41 +0000 (18:15 +0800)
search/classes/area/base.php
version.php

index 78aa3b8..1e887e1 100644 (file)
@@ -136,7 +136,14 @@ abstract class base {
      * @return string
      */
     public function get_visible_name($lazyload = false) {
-        return get_string('search:' . $this->areaname, $this->componentname, null, $lazyload);
+
+        $component = $this->componentname;
+
+        // Core subsystem strings go to lang/XX/search.php.
+        if (strpos($component, 'core_') === 0) {
+            $component = 'search';
+        }
+        return get_string('search:' . $this->areaname, $component, null, $lazyload);
     }
 
     /**
@@ -150,8 +157,9 @@ abstract class base {
     public function get_config_var_name() {
 
         if ($this->componenttype === 'core') {
-            // Core subsystems config in search.
-            return array('search', $this->areaid);
+            // Core subsystems config in core_search and setting name using only [a-zA-Z0-9_]+.
+            $parts = \core_search\manager::extract_areaid_parts($this->areaid);
+            return array('core_search', $parts[0] . '_' . $parts[1]);
         }
 
         // Plugins config in the plugin scope.
index a32b155..56df63e 100644 (file)
@@ -29,7 +29,7 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$version  = 2016050600.00;              // YYYYMMDD      = weekly release date of this DEV branch.
+$version  = 2016050600.01;              // YYYYMMDD      = weekly release date of this DEV branch.
                                         //         RR    = release increments - 00 in DEV branches.
                                         //           .XX = incremental changes.