Moodle
  1. Moodle
  2. MDL-32745

Course ajax causes JS errors when used in site main menu block

    Details

    • Testing Instructions:
      Hide

      These tests should be completed with the javascript console open to check for errors.

      • Open the Site Front Page and turn editing on
      • In the central resource area:
      • Create a couple of activities including:
        • a label
        • an activity
        • another resource
      • try each of the AJAX functions to ensure that they work:
        • indent right
        • indent left
        • show
        • hide
        • group mode toggle (on the activity)
        • delete
      • If you don't already have it, add a 'Main Menu' block on the site front page
      • Create a couple of activities including:
        • a label
        • an activity
        • another resource
      • try each of the function icons – they should cause page reloads now:
        • show
        • hide
        • group mode toggle (on the activity)
        • delete
      • Open a course page and turn editing on
      • In the first topic/week area:
      • Create a couple of activities including:
        • a label
        • an activity
        • another resource
      • try each of the AJAX functions to ensure that they work:
        • indent right
        • indent left
        • show
        • hide
        • group mode toggle (on the activity)
        • delete
        • toggle the section/week visibility
      Show
      These tests should be completed with the javascript console open to check for errors. Open the Site Front Page and turn editing on In the central resource area: Create a couple of activities including: a label an activity another resource try each of the AJAX functions to ensure that they work: indent right indent left show hide group mode toggle (on the activity) delete If you don't already have it, add a 'Main Menu' block on the site front page Create a couple of activities including: a label an activity another resource try each of the function icons – they should cause page reloads now: show hide group mode toggle (on the activity) delete Open a course page and turn editing on In the first topic/week area: Create a couple of activities including: a label an activity another resource try each of the AJAX functions to ensure that they work: indent right indent left show hide group mode toggle (on the activity) delete toggle the section/week visibility
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_23_STABLE
    • Fixed Branches:
      MOODLE_23_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-32745-master-1
    • Rank:
      39737

      Description

      I discovered that there's another location which has section menus - the site_main_menu block. At present we apply the JS to this, but the block doesn't provide enough information at present to automate it.

      It's probably a bit late in the game to start adding relevant data along with any rewrites of the javascript that might be required so I've got a fix to ensure that it's not within the scope and doesn't get instantiated.

        Issue Links

          Activity

          Hide
          Ruslan Kabalin added a comment -

          +1 from me

          Show
          Ruslan Kabalin added a comment - +1 from me
          Hide
          Dan Poltawski added a comment -

          Thanks, that has been integrated now

          Show
          Dan Poltawski added a comment - Thanks, that has been integrated now
          Hide
          Rossiani Wijaya added a comment -

          While testing this, the following JS error occurs for adding these resources: file, folder, ims content, and url

          Error: extend failed, please check that all dependencies are included.
          Source File: http://moodle/theme/yui_combo.php/2.9.0/build/yahoo/yahoo.js
          Line: 767
          

          Result from testing:

          • Create a couple of activities including:
            • a label - ok
            • an activity - ok
            • another resource - JS error for: file, folder, ims content, url
          • try each of the AJAX functions to ensure that they work:
            • indent right - ok
            • indent left - ok
            • show - after clicking, it displays text instead of icon
            • hide - after clicking, it displays text instead of icon
            • group mode toggle (on the activity) - after clicking, it displays text instead of icon
            • delete - ok
          • If you don't already have it, add a 'Main Menu' block on the site front page
          • Create a couple of activities including:
            • a label - ok
            • an activity - ok
            • another resource - JS error for: file, folder, ims content, url
          • try each of the function icons – they should cause page reloads now:
            • show - ok
            • hide - ok
            • group mode toggle (on the activity) ok
            • delete ok
          • Open a course page and turn editing on
          • In the first topic/week area:
          • Create a couple of activities including:
            • a label - ok
            • an activity - ok
            • another resource - JS error for: file, folder, ims content, url
          • try each of the AJAX functions to ensure that they work:
            • indent right - ok
            • indent left - ok
            • show - after clicking, it displays text instead of icon
            • hide - after clicking, it displays text instead of icon
            • group mode toggle (on the activity) - after clicking, it displays text instead of icon
            • delete - ok
            • toggle the section/week visibility - after clicking, it displays text instead of icon
          Show
          Rossiani Wijaya added a comment - While testing this, the following JS error occurs for adding these resources: file, folder, ims content, and url Error: extend failed, please check that all dependencies are included. Source File: http: //moodle/theme/yui_combo.php/2.9.0/build/yahoo/yahoo.js Line: 767 Result from testing: Create a couple of activities including: a label - ok an activity - ok another resource - JS error for: file, folder, ims content, url try each of the AJAX functions to ensure that they work: indent right - ok indent left - ok show - after clicking, it displays text instead of icon hide - after clicking, it displays text instead of icon group mode toggle (on the activity) - after clicking, it displays text instead of icon delete - ok If you don't already have it, add a 'Main Menu' block on the site front page Create a couple of activities including: a label - ok an activity - ok another resource - JS error for: file, folder, ims content, url try each of the function icons – they should cause page reloads now: show - ok hide - ok group mode toggle (on the activity) ok delete ok Open a course page and turn editing on In the first topic/week area: Create a couple of activities including: a label - ok an activity - ok another resource - JS error for: file, folder, ims content, url try each of the AJAX functions to ensure that they work: indent right - ok indent left - ok show - after clicking, it displays text instead of icon hide - after clicking, it displays text instead of icon group mode toggle (on the activity) - after clicking, it displays text instead of icon delete - ok toggle the section/week visibility - after clicking, it displays text instead of icon
          Hide
          Andrew Nicols added a comment -

          Hmm - I'm not sure where these JS errors are coming from. Still looking but here are my initial findings:

          I've just tried on integration.git/master and I'm see the same things but not on any of the course AJAX - I'm seeing them on modedit.php

          MDL-32683 seems to have changed how M.util.image_url works when called without a component.

          As I say, still looking...

          Show
          Andrew Nicols added a comment - Hmm - I'm not sure where these JS errors are coming from. Still looking but here are my initial findings: I've just tried on integration.git/master and I'm see the same things but not on any of the course AJAX - I'm seeing them on modedit.php MDL-32683 seems to have changed how M.util.image_url works when called without a component. As I say, still looking...
          Hide
          Andrew Nicols added a comment -

          Yup- MDL-32683 has removed the ability to not specify a component in M.util.image_url wich is causing the missing icons. Text being displayed will be the alt text and browser dependant.

          Show
          Andrew Nicols added a comment - Yup- MDL-32683 has removed the ability to not specify a component in M.util.image_url wich is causing the missing icons. Text being displayed will be the alt text and browser dependant.
          Hide
          Andrew Nicols added a comment -

          This is actually an existing issue already present on master, though interestingly not on MOODLE_22_STABLE which uses the same version of YUI2. Still investigating

          Show
          Andrew Nicols added a comment - This is actually an existing issue already present on master, though interestingly not on MOODLE_22_STABLE which uses the same version of YUI2. Still investigating
          Hide
          Andrew Nicols added a comment -

          The remaining JS errors seem to be a regression caused by MDL-32448 (thank you git bisect for making life easier)
          If so, then these errors are only seen on modedit.php and not on course/view.php in editing mode and shouldn't fail this issue IMO.

          Show
          Andrew Nicols added a comment - The remaining JS errors seem to be a regression caused by MDL-32448 (thank you git bisect for making life easier) If so, then these errors are only seen on modedit.php and not on course/view.php in editing mode and shouldn't fail this issue IMO.
          Hide
          Dan Poltawski added a comment -

          Andrew, could you create an issue for that and assign it to Petr (especially as it might be resolved by 3.5.1 import?)

          Show
          Dan Poltawski added a comment - Andrew, could you create an issue for that and assign it to Petr (especially as it might be resolved by 3.5.1 import?)
          Hide
          Andrew Nicols added a comment -

          Was just in the process of doing so. Have just created MDL-32846 and will link

          Show
          Andrew Nicols added a comment - Was just in the process of doing so. Have just created MDL-32846 and will link
          Hide
          Rossiani Wijaya added a comment -

          The above issues seem to be fixed with the latest integration.

          Thank Andrew for investigating this throughly.

          Test passed.

          Show
          Rossiani Wijaya added a comment - The above issues seem to be fixed with the latest integration. Thank Andrew for investigating this throughly. Test passed.
          Hide
          Eloy Lafuente (stronk7) added a comment -

          This is now part of Moodle and a few millions people around the globe will be using it soon. Isn't that awesome?

          Many, many thanks and don't forget http://youtu.be/4N7dPaP5Z8U

          Closing, ciao

          Show
          Eloy Lafuente (stronk7) added a comment - This is now part of Moodle and a few millions people around the globe will be using it soon. Isn't that awesome? Many, many thanks and don't forget http://youtu.be/4N7dPaP5Z8U Closing, ciao

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: