Moodle
  1. Moodle
  2. MDL-26955

lang not being picked up from themes in custom themedir

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0.1
    • Fix Version/s: 2.0.3
    • Component/s: Themes
    • Environment:
      Moodle 2.0.1, Apache, PHP 5.2
    • Rank:
      16960

      Description

      Whenever using a custom theme directory, $CFG->themedir, I am unable to load any themes. Sometimes the theme will show up as '#[[configtitle]] #[[pluginname]]' in the Moodle->Appearance->Theme menu. I am also unable to select any of these themes.

      http://tracker.moodle.org/browse/MDL-20799

        Issue Links

          Activity

          Hide
          Patrick Malley added a comment -

          Falls outside the theme directory. I'm not sure how to fix.

          Show
          Patrick Malley added a comment - Falls outside the theme directory. I'm not sure how to fix.
          Hide
          jai gupta added a comment -

          Workaround

          File: /lib/moodlelib.php
          function get_plugin_directory

          Add following code above return statement.

          ====================
          global $CFG;
          if ($plugintype=='theme' && !file_exists($types[$plugintype].'/'.$name) && file_exists($CFG->themedir))

          { return $CFG->themedir.'/'.$name; }

          ====================

          Show
          jai gupta added a comment - Workaround File: /lib/moodlelib.php function get_plugin_directory Add following code above return statement. ==================== global $CFG; if ($plugintype=='theme' && !file_exists($types [$plugintype] .'/'.$name) && file_exists($CFG->themedir)) { return $CFG->themedir.'/'.$name; } ====================
          Hide
          Urs Hunkler added a comment -

          I created two branches on a Moodle fork on Github to solve the external themedir issue. The branch with the solution for this issue is https://github.com/uhunkler/moodle2_optimized4design/commits/MDL-26955_lang_problem_in_custom_themedir. Have a look there and feel free to pull the solution.

          Show
          Urs Hunkler added a comment - I created two branches on a Moodle fork on Github to solve the external themedir issue. The branch with the solution for this issue is https://github.com/uhunkler/moodle2_optimized4design/commits/MDL-26955_lang_problem_in_custom_themedir . Have a look there and feel free to pull the solution.
          Hide
          David Mudrak added a comment -

          Thanks Urs for the idea of the patch. However, we may need this check at other places too so I added the check directly into the get_plugin_directory() function.

          Integrators, please pull the patch that adds support for $CFG->themedir into get_plugin_directory() function. Once that is done, get_string() works for the themes in that location, too.

          Show
          David Mudrak added a comment - Thanks Urs for the idea of the patch. However, we may need this check at other places too so I added the check directly into the get_plugin_directory() function. Integrators, please pull the patch that adds support for $CFG->themedir into get_plugin_directory() function. Once that is done, get_string() works for the themes in that location, too.
          Hide
          David Mudrak added a comment -

          And thanks Jai, too. My patch basically modifies the same place, it just saves filesystem operations.

          Show
          David Mudrak added a comment - And thanks Jai, too. My patch basically modifies the same place, it just saves filesystem operations.
          Hide
          Urs Hunkler added a comment -

          I checked your solution on m2stable and it works here.

          Show
          Urs Hunkler added a comment - I checked your solution on m2stable and it works here.
          Hide
          Sam Hemelryk added a comment -

          Thanks guys this has been integrated now.

          Show
          Sam Hemelryk added a comment - Thanks guys this has been integrated now.
          Hide
          Aparup Banerjee added a comment -

          this has tested awesomely in MDL-27116

          Show
          Aparup Banerjee added a comment - this has tested awesomely in MDL-27116
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Once again, many thanks!

          Show
          Eloy Lafuente (stronk7) added a comment - Once again, many thanks!

            People

            • Votes:
              2 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: