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

lib/requirejs.php should give a meaningful error for js files that cannot be loaded

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      The main think it to check no regressions, and I expect behat will do that for us.

      If you really want to test the new code, try this:

      1. Ensure Cache Javascript is turned on.
      2. Do chmod 333 on one .../amd/build/....min.js file. - Hmm! not sure this accruately reflects the state that cygwin got my development site into. This may not acutally reproduce the bug.
      3. Purge caches.
      4. Load any page in your Moodle site.
      5. Look in the PHP log, and make sure that there is something there about the JS file that coudl not be loaded.
      6. Using your browser develoepr tools, find the URL for first.js, and open that in a new browser tab.
      7. Verify that inside that file is a comment like /* Failed to load JavaScript file [PATH NAME]. */.
      Show
      The main think it to check no regressions, and I expect behat will do that for us. If you really want to test the new code, try this: Ensure Cache Javascript is turned on. Do chmod 333 on one .../amd/build/....min.js file. - Hmm! not sure this accruately reflects the state that cygwin got my development site into. This may not acutally reproduce the bug. Purge caches. Load any page in your Moodle site. Look in the PHP log, and make sure that there is something there about the JS file that coudl not be loaded. Using your browser develoepr tools, find the URL for first.js, and open that in a new browser tab. Verify that inside that file is a comment like /* Failed to load JavaScript file [PATH NAME] . */.
    • Affected Branches:
      MOODLE_32_STABLE, MOODLE_33_STABLE
    • Fixed Branches:
      MOODLE_32_STABLE, MOODLE_33_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      Description

      Steps to reproduce:

      1. Do you development under Windows + Cygwin.
      2. Make a new AMD module in one of your plugins and run grunt.
      3. Try to work out why you new JavaScript code works in your development install (that is using src/newmod.js) but not in Behat (which is trying to use build/newmod.min.js).

      What is going on is that in this setup, build/newmod.min.js is created with file permission 700, when it should be 644.

      Then, requirejs.php, when it tries to assemble first.js, does not check the return value of file_get_contents. It just silently convers false to '' without logging anything.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                timhunt Tim Hunt
                Reporter:
                timhunt Tim Hunt
                Peer reviewer:
                Dan Poltawski
                Integrator:
                David Monllaó
                Tester:
                Andrew Nicols
                Participants:
                Component watchers:
                Jake Dallimore, Jun Pataleta, Ryan Wyllie, Amaia Anabitarte, Bas Brands, Carlos Escobedo, Sara Arjona (@sarjona), Víctor Déniz Falcón
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  11/Sep/17