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

Non-standard/buggy theme javascript causes minify to fail completely

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.1
    • Fix Version/s: 2.3
    • Component/s: Themes
    • Labels:
    • Environment:
      LAMP
    • Testing Instructions:
      Hide

      For developers:
      1/ add some non-standard javascript to some theme (see description if you need example)
      2/ verify minimisation failure is logged in console and the file itself
      3/ create a page that requires faulty js script, verify console logged the problem

      no idea how to create faulty css, sorry

      Show
      For developers: 1/ add some non-standard javascript to some theme (see description if you need example) 2/ verify minimisation failure is logged in console and the file itself 3/ create a page that requires faulty js script, verify console logged the problem no idea how to create faulty css, sorry
    • Affected Branches:
      MOODLE_21_STABLE
    • Fixed Branches:
      MOODLE_23_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      w10_MDL-31079_m23_minifydebug

      Description

      When adding a javascript file via a theme config, a line like (this is jquery):

      if (href.search(/^[^:/]:\/\/[^/]\/?/) == -1){

      }

      is executed by browser despite the fact that the regex is not properly quoted. This creates fatal problems when minifying the javascript in non-developer modes in Moodle. There are other types of incompatible JS constructs that may be silently ignored by some browsers.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Votes:
                  13 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    25/Jun/12