Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-50346

Remove the restriction to forbid subdirectories in the templates directory

    XMLWordPrintable

Details

    • MOODLE_29_STABLE, MOODLE_38_STABLE
    • MOODLE_38_STABLE
    • MDL-50346-master
    • Hide
      1. Download 50346.zip from the issue
      2. Unzip it in the moodle root
      3. Log in as admin
      4. Open Site admin => Development => Template library
      5. Search for core/modal
        1. Confirm that you see an exact match and nothing in a theme directory.
      6. Select core/modal
        1. Confirm that you see an example which says:

          This is no longer a modal in any theme.
          

      7. Search for mod_forum/form/checkbox_toggle
        1. Confirm that you see an exact match and nothing in a theme directory.
      8. Select it
        1. Confirm that you see an example which says:

          Fail this issue if you see this message in the boost theme. It should only work in boost.
          

      9. Search for local/foo/bar
        1. Confirm that you see a match for "theme_boost/local/foo/bar"
      10. Select it
        1. Confirm that you see an example which says:

          You should be able to see this in any theme!
          

      11. Switch to the classic theme
      12. Search for core/modal
        1. Confirm that you see an exact match and nothing in a theme directory.
      13. Select core/modal
        1. Confirm that you see an example which says:

          This is no longer a modal in any theme.
          

      14. Search for mod_forum/form/checkbox_toggle
        1. Confirm that you see an exact match and nothing in a theme directory.
      15. Select it
        1. Confirm that you see an example which says:

          Fail this issue if you see this message in the boost theme. It should only work in classic.
          

      16. Search for local/foo/bar
        1. Confirm that you see a match for "theme_boost/local/foo/bar"
      17. Select it
        1. Confirm that you see an example which says:

          You should be able to see this in any theme!
          

      Show
      Download 50346.zip from the issue Unzip it in the moodle root Log in as admin Open Site admin => Development => Template library Search for core/modal Confirm that you see an exact match and nothing in a theme directory. Select core/modal Confirm that you see an example which says: This is no longer a modal in any theme. Search for mod_forum/form/checkbox_toggle Confirm that you see an exact match and nothing in a theme directory. Select it Confirm that you see an example which says: Fail this issue if you see this message in the boost theme. It should only work in boost. Search for local/foo/bar Confirm that you see a match for " theme_boost/local/foo/bar " Select it Confirm that you see an example which says: You should be able to see this in any theme! Switch to the classic theme Search for core/modal Confirm that you see an exact match and nothing in a theme directory. Select core/modal Confirm that you see an example which says: This is no longer a modal in any theme. Search for mod_forum/form/checkbox_toggle Confirm that you see an exact match and nothing in a theme directory. Select it Confirm that you see an example which says: Fail this issue if you see this message in the boost theme. It should only work in classic. Search for local/foo/bar Confirm that you see a match for " theme_boost/local/foo/bar " Select it Confirm that you see an example which says: You should be able to see this in any theme!
    • Internationals - 3.8 Sprint 3, Internationals - 3.8 Sprint 4

    Description

      In MDL-50085 the possibility to use subdirectories in the »templates« directory as been removed. This restriction makes it more difficult to structure templates. Mustache works with partials - it would be helpful to able to use the »partials« directory in the »templates« directory.

      At line 106 of »lib/classes/output/mustache_template_finder.php« the test for a »/« has been added.
      {{
      if (strpos($templatename, '/') !== false)

      { throw new coding_exception('Templates cannot be placed in sub directories (' . s($name) . ' requested)'); }

      }}

      When I comment out the test subdirectory works again.

      Why is this test needed? I don't see the point.

      Please remove this restriction again.

      Attachments

        1. 50346.zip
          4 kB
        2. MDL-50346_Boost.jpg
          MDL-50346_Boost.jpg
          46 kB
        3. MDL-50346_Classic.jpg
          MDL-50346_Classic.jpg
          38 kB

        Issue Links

          Activity

            People

              dobedobedoh Andrew Lyons
              urshunkler Urs Hunkler
              Simey Lameze Simey Lameze
              Jun Pataleta Jun Pataleta
              Anna Carissa Sadia Anna Carissa Sadia
              Andrew Lyons, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              7 Vote for this issue
              Watchers:
              15 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                18/Nov/19

                Time Tracking

                  Estimated:
                  Original Estimate - 1 day Original Estimate - 1 day
                  1d
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 day, 2 hours
                  1d 2h