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

LESS Source Map generation produces incorrect URL.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.9
    • Fix Version/s: 2.9.4, 3.0.1
    • Component/s: Themes
    • Labels:
    • Testing Instructions:
      Hide

      Test in both linux (or osx) and windows

      1. Using the 'Chrome' browser.
      2. Select the 'More' theme.
      3. Turn on 'theme designer mode'.
      4. Activate 'browser development tools' with the F12 key.
      5. Inspect an element of HTML and look at its styles.
      6. Pick a style that is defined in a 'less' file.
      7. Hover over the filename and click on it
      8. The file SHOULD be opened correctly (not a blank page)
      Show
      Test in both linux (or osx) and windows Using the 'Chrome' browser. Select the 'More' theme. Turn on 'theme designer mode'. Activate 'browser development tools' with the F12 key. Inspect an element of HTML and look at its styles. Pick a style that is defined in a 'less' file. Hover over the filename and click on it The file SHOULD be opened correctly (not a blank page)
    • Workaround:
      Hide

      Use the 'human' brain to determine where the file is locally and manually open it.

      Show
      Use the 'human' brain to determine where the file is locally and manually open it.
    • Affected Branches:
      MOODLE_29_STABLE
    • Fixed Branches:
      MOODLE_29_STABLE, MOODLE_30_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-50258_master

      Description

      When in theme designer mode with a theme that uses the PHP LESS compiler (such as More) and you use a compatible browser (such as Chrome) the linked source files have a corrupted URL that is a mixture of the server and physical file path (using 'http' etc instead of 'file' protocol). Image attached illustrating the issue.

      I have attempted to find a solution in this forum thread: https://moodle.org/mod/forum/discuss.php?d=313061 - but did not come up with a complete solution. There is something clearly going on with the 'root' of the map needing to be the 'theme' folder itself rather than an individual theme such that themes with parents will work.

      I've only tested in M2.9 on Windows, but could affect older versions as far back as M2.7.

      The solution should be not to have the 'filename path' on the physical storage medium but rather the correct URL for the web server to access the file. However, this may cause issues with 'themedir' so a compromise needs to be made that in this case 'themedir' would not be supported in favour of flexibility in development environments.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                1 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  21/Dec/15