Moodle
  1. Moodle
  2. MDL-39949

Block without header causes JS error on page

    Details

    • Testing Instructions:
      Hide

      Test 1

      1. Turn editing on for blocks
      2. Create a HTML block with quotes and double quotes in the title
      3. Hover over the Dock icon on the block, ensure the block's name is mentioned in the tool tip
      4. Turn editing on for blocks
      5. Hover over the Dock icon on the HTML block, ensure the block's name is mentioned in the tool tip

      Test 2

      1. Add a block that does not have a title to a course page
      2. Try to launch and use the activity chooser

      It should open and function without error.

      Show
      Test 1 Turn editing on for blocks Create a HTML block with quotes and double quotes in the title Hover over the Dock icon on the block, ensure the block's name is mentioned in the tool tip Turn editing on for blocks Hover over the Dock icon on the HTML block, ensure the block's name is mentioned in the tool tip Test 2 Add a block that does not have a title to a course page Try to launch and use the activity chooser It should open and function without error.
    • Affected Branches:
      MOODLE_25_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      wip-MDL-39949-master
    • Story Points:
      3
    • Rank:
      381
    • Sprint:
      FRONTEND Sprint 1

      Description

      Updated description:

      Reporter noticed a Javascript error in some courses' pages in editing mode. It causes activity chooser to fail to work. If blocks without headings are removed, JS code starts working again so presumably presence of those blocks causes the error.


      Original description:

      Thread here: https://moodle.org/mod/forum/discuss.php?d=228086#p997260

      Upgraded to 2.5 from 2.3 this week, initially used an incomplete zip file. Subsequently corrected. Since then the Activity Chooser behaves inconsistently in courses.

      Case 1
      In some courses it is greyed out. Switching it off allows the drop-down lists to work - but only if you quickly select an option, otherwise it fails - jumpto.php appears to get an empty string in this case and also drag and drop of course items does not work.

      Case 2
      In some other courses, using the Activity Chooser to select an activity or resource generates an error on selection of the activity or resource. Switching off the Activity chooser allows selection properly through the drop-down lists. In these course drag and drop of items works as expected.

      We are using Moodle 2.5+ (Build: 20130524) on SQL SERVER 2008 MS SQL 10.5.250 PHP 5.3.18 FreeTDS drivers.

      Upgrade error was reported in MDL-39869 (closed).

        Issue Links

          Activity

          Hide
          Richard Jones added a comment -

          I have just checked the last years corresponding course on the system (Case 1) and it shows exactly the same behaviour and yet it won't have been edited this year - ie this is unlikely to be some kind of error generated by an incomplete or incorrect upgrade corrupting the database, for example.

          Show
          Richard Jones added a comment - I have just checked the last years corresponding course on the system (Case 1) and it shows exactly the same behaviour and yet it won't have been edited this year - ie this is unlikely to be some kind of error generated by an incomplete or incorrect upgrade corrupting the database, for example.
          Hide
          Richard Jones added a comment -

          Just tried adding a completely new course - the Activity chooser on setting does not work for new courses - the error occurs as in Case 2.

          Show
          Richard Jones added a comment - Just tried adding a completely new course - the Activity chooser on setting does not work for new courses - the error occurs as in Case 2.
          Hide
          Richard Jones added a comment - - edited

          On our test server which has been through 2.3 2.4 and 2.5 upgrades, the same thing. Comparing two courses side by side, one of which has problems and the other of which does not, the only difference I see is 4 Javascript modules loaded in the course with errors and 3 in the other - is there any code I can edit which would reveal which actual modules were loaded?

          I looked at the source elements and there is a whole bunch of js missing from the courses with errors where the chooser code should appear:

          In the good course:
          <div class="visibleifjs addresourcemodchooser" id="yui_3_9_1_2_1369976435642_2967"><div class="mdl-right" id="yui_3_9_1_2_1369976435642_2966"><div class="section-modchooser" id="yui_3_9_1_2_1369976435642_2965"><span class="section-modchooser-link" id="yui_3_9_1_2_1369976435642_2964"><a href="#" id="yui_3_9_1_2_1369976435642_2963"><img alt="" class="smallicon" title="" src="http://lms-test.tssnet.local/theme/image.php/standard/core/1369882574/t/add"><span class="section-modchooser-text" id="yui_3_9_1_2_1369976435642_2962">Add an activity or resource</span></a></span></div></div></div>

          In the course with errors, simply:
          <div class="hd choosertitle">Add an activity or resource</div>

          Is that a typo for id??

          Show
          Richard Jones added a comment - - edited On our test server which has been through 2.3 2.4 and 2.5 upgrades, the same thing. Comparing two courses side by side, one of which has problems and the other of which does not, the only difference I see is 4 Javascript modules loaded in the course with errors and 3 in the other - is there any code I can edit which would reveal which actual modules were loaded? I looked at the source elements and there is a whole bunch of js missing from the courses with errors where the chooser code should appear: In the good course: <div class="visibleifjs addresourcemodchooser" id="yui_3_9_1_2_1369976435642_2967"><div class="mdl-right" id="yui_3_9_1_2_1369976435642_2966"><div class="section-modchooser" id="yui_3_9_1_2_1369976435642_2965"><span class="section-modchooser-link" id="yui_3_9_1_2_1369976435642_2964"><a href="#" id="yui_3_9_1_2_1369976435642_2963"><img alt="" class="smallicon" title="" src="http://lms-test.tssnet.local/theme/image.php/standard/core/1369882574/t/add"><span class="section-modchooser-text" id="yui_3_9_1_2_1369976435642_2962">Add an activity or resource</span></a></span></div></div></div> In the course with errors, simply: <div class="hd choosertitle">Add an activity or resource</div> Is that a typo for id??
          Hide
          Marina Glancy added a comment -

          Hi Richard,
          thanks for reporting it. This looks like some other JS error on the page. I answered in the forum, maybe Andrew Nicols adds something as our Javascript expert
          Marina

          Show
          Marina Glancy added a comment - Hi Richard, thanks for reporting it. This looks like some other JS error on the page. I answered in the forum, maybe Andrew Nicols adds something as our Javascript expert Marina
          Hide
          Andrew Nicols added a comment -

          Hi Richard,

          Can you just confirm that you've cleared your Moodle Cache by visitng Administration -> Site administration -> Development -> Purge all caches.

          It looks like the two sections of HTML you're comparing are different things - the 'good' version is the link you click on, whilst the 'bad' is the HTML markup for the actual popup window before it has been instantiated.

          It does sound like you've still not got everything quite right with your installation - In Moodle 2.5 we made some changes to the way in which JavaScript is loaded and it looks like you're missing some part of that stack. Are there any errors in your browser console log - in your browser, hit F12 (usually anyway) to bring up the developer tools, and open the Console/Errors tab.

          Andrew

          Show
          Andrew Nicols added a comment - Hi Richard, Can you just confirm that you've cleared your Moodle Cache by visitng Administration -> Site administration -> Development -> Purge all caches. It looks like the two sections of HTML you're comparing are different things - the 'good' version is the link you click on, whilst the 'bad' is the HTML markup for the actual popup window before it has been instantiated. It does sound like you've still not got everything quite right with your installation - In Moodle 2.5 we made some changes to the way in which JavaScript is loaded and it looks like you're missing some part of that stack. Are there any errors in your browser console log - in your browser, hit F12 (usually anyway) to bring up the developer tools, and open the Console/Errors tab. Andrew
          Hide
          Richard Jones added a comment -

          Thanks Andrew and Marina

          I purged all caches. No difference.

          I wonder why the exact same thing happens on the test server and why only some courses are affected? I also wonder why some courses are having errors with the Activity Chooser but the drop-downs are working OK.

          Yes there are console errors:

          Blocked a frame with origin "https://www.youtube.com" from accessing a frame with origin "http://lms.tss.qld.edu.au". The frame requesting access has a protocol of "https", the frame being accessed has a protocol of "http". Protocols must match.

          Uncaught TypeError: Cannot call method 'getHTML' of null

          The first is only related to a YouTube video, when it is removed the error disappears but the problem remains. The second doesn't help me much.

          Show
          Richard Jones added a comment - Thanks Andrew and Marina I purged all caches. No difference. I wonder why the exact same thing happens on the test server and why only some courses are affected? I also wonder why some courses are having errors with the Activity Chooser but the drop-downs are working OK. Yes there are console errors: Blocked a frame with origin "https://www.youtube.com" from accessing a frame with origin "http://lms.tss.qld.edu.au". The frame requesting access has a protocol of "https", the frame being accessed has a protocol of "http". Protocols must match. Uncaught TypeError: Cannot call method 'getHTML' of null The first is only related to a YouTube video, when it is removed the error disappears but the problem remains. The second doesn't help me much.
          Hide
          Marina Glancy added a comment -

          this may be connected to MDL-32946 then, Jason Fowler please take a look at it. It seems that this line causes the error:
          https://github.com/moodle/moodle/blob/master/blocks/dock.js#L840
          (probably there is a block without heading?)

          Show
          Marina Glancy added a comment - this may be connected to MDL-32946 then, Jason Fowler please take a look at it. It seems that this line causes the error: https://github.com/moodle/moodle/blob/master/blocks/dock.js#L840 (probably there is a block without heading?)
          Hide
          Marina Glancy added a comment -

          Richard, can you say if you have any docked blocks on the pages that cause errors? Especially interesting are the blocks without headers

          Show
          Marina Glancy added a comment - Richard, can you say if you have any docked blocks on the pages that cause errors? Especially interesting are the blocks without headers
          Hide
          Richard Jones added a comment - - edited

          Yes, that's fixed it, thanks Marina. There was an empty html block on the page, when deleted the error goes away. Strangely that course also has two Navigation blocks, neither of which can be removed. That has solved "Case 1". Ajax drag and drop is also now restored in this course.

          However, using the Activity chooser generates the error when the Add button is pressed after selecting a radio button. This is less serious as the drop-down lists will get the job down and actually are simpler for some teachers.

          Show
          Richard Jones added a comment - - edited Yes, that's fixed it, thanks Marina. There was an empty html block on the page, when deleted the error goes away. Strangely that course also has two Navigation blocks, neither of which can be removed. That has solved "Case 1". Ajax drag and drop is also now restored in this course. However, using the Activity chooser generates the error when the Add button is pressed after selecting a radio button. This is less serious as the drop-down lists will get the job down and actually are simpler for some teachers.
          Hide
          Marina Glancy added a comment -

          ok, now it's definitely a regression from MDL-32946, bumping priority

          Show
          Marina Glancy added a comment - ok, now it's definitely a regression from MDL-32946 , bumping priority
          Hide
          Andrew Nicols added a comment -

          Thanks for looking into this Marina.

          Show
          Andrew Nicols added a comment - Thanks for looking into this Marina.
          Hide
          Jason Fowler added a comment -

          The description and summary of this issue seem to be at odds. What does a block have to do with the activity chooser?

          Will press to have this as a priority in our next sprint (starts today), and I will work on it then.

          Show
          Jason Fowler added a comment - The description and summary of this issue seem to be at odds. What does a block have to do with the activity chooser? Will press to have this as a priority in our next sprint (starts today), and I will work on it then.
          Hide
          Marina Glancy added a comment -

          Jason, the JS code for blocks fails with fatal error and after that no JS works on page. So it was noticed and reported first as "activity chooser is not working". Then we dug into the causes and had to re-write the issue name

          Show
          Marina Glancy added a comment - Jason, the JS code for blocks fails with fatal error and after that no JS works on page. So it was noticed and reported first as "activity chooser is not working". Then we dug into the causes and had to re-write the issue name
          Hide
          Jason Fowler added a comment -

          Ah, that makes sense, thanks Marina.

          Show
          Jason Fowler added a comment - Ah, that makes sense, thanks Marina.
          Hide
          Marina Glancy added a comment -

          Richard, can you please explain what you mean by: "However, using the Activity chooser generates the error when the Add button is pressed after selecting a radio button. This is less serious as the drop-down lists will get the job down and actually are simpler for some teachers."
          by how it sounds it may be a bug as well. Can you copy-paste the error code here?
          And thanks a lot again for your co-operation, it really helps us to find the causes of the bug.

          Show
          Marina Glancy added a comment - Richard, can you please explain what you mean by: "However, using the Activity chooser generates the error when the Add button is pressed after selecting a radio button. This is less serious as the drop-down lists will get the job down and actually are simpler for some teachers." by how it sounds it may be a bug as well. Can you copy-paste the error code here? And thanks a lot again for your co-operation, it really helps us to find the causes of the bug.
          Hide
          Richard Jones added a comment -

          When the Activity Chooser is turned on and an activity is selected, clicking the add button generates an error - unspecified. No error code. Seems to be a bug.

          I have forced the Activity Chooser off by default using the admin setting so users are mostly served with the drop down lists, which are working. That's what I meant by less serious for users - there is a work-around.

          I'm not on site today but will turn on debugging when I get back. We are using SQL server as previously specified. I have another Moodle 2.5 install running on CentOS and that is not showing any issues.

          Show
          Richard Jones added a comment - When the Activity Chooser is turned on and an activity is selected, clicking the add button generates an error - unspecified. No error code. Seems to be a bug. I have forced the Activity Chooser off by default using the admin setting so users are mostly served with the drop down lists, which are working. That's what I meant by less serious for users - there is a work-around. I'm not on site today but will turn on debugging when I get back. We are using SQL server as previously specified. I have another Moodle 2.5 install running on CentOS and that is not showing any issues.
          Hide
          Richard Jones added a comment -

          No errors to report just the not very helpful:
          Debug info:
          Error code: error
          Stack trace:
          line 476 of \lib\setuplib.php: moodle_exception thrown
          line 42 of \course\jumpto.php: call to print_error()

          Also no Javascript errors reported in the Chrome console.

          Show
          Richard Jones added a comment - No errors to report just the not very helpful: Debug info: Error code: error Stack trace: line 476 of \lib\setuplib.php: moodle_exception thrown line 42 of \course\jumpto.php: call to print_error() Also no Javascript errors reported in the Chrome console.
          Hide
          Jason Fowler added a comment -

          Richard Jones I haven't been able to reproduce this issue. Can you please explain which blocks you have on the page that this is triggered on, so I can have a go at getting it to work too?

          Show
          Jason Fowler added a comment - Richard Jones I haven't been able to reproduce this issue. Can you please explain which blocks you have on the page that this is triggered on, so I can have a go at getting it to work too?
          Hide
          Richard Jones added a comment -

          Which issue are we now talking about? The Block without Header occurred only in one specific course and could be regarded as an anomaly - it also happened with a restored version of the same course but with no other courses. I removed the block and now it has the same problem as the other courses.

          The issue I'm seeing in every course, regardless of blocks, is that the newer style Activity Chooser generates an error when you try to use it. I can confirm that this does not happen on other installs of Moodle I have running 2.5+ over Debian and CentOS. That means it is something unique to us (which I don't believe because other have reported it in the forums) or possibly it is related to the SQL server/Windows environment etc.

          Perhaps the bug should be put back to its original description "Activity Chooser not working"?

          Show
          Richard Jones added a comment - Which issue are we now talking about? The Block without Header occurred only in one specific course and could be regarded as an anomaly - it also happened with a restored version of the same course but with no other courses. I removed the block and now it has the same problem as the other courses. The issue I'm seeing in every course, regardless of blocks, is that the newer style Activity Chooser generates an error when you try to use it. I can confirm that this does not happen on other installs of Moodle I have running 2.5+ over Debian and CentOS. That means it is something unique to us (which I don't believe because other have reported it in the forums) or possibly it is related to the SQL server/Windows environment etc. Perhaps the bug should be put back to its original description "Activity Chooser not working"?
          Hide
          Marina Glancy added a comment -

          Richard, can you tell us which theme are you using?

          Show
          Marina Glancy added a comment - Richard, can you tell us which theme are you using?
          Hide
          Marina Glancy added a comment -

          sorry, somehow I missed your message about the "add module" button. From what you say it should be absolutely the same if activitychooser is off. Which module are you trying to add when you get this error? Does it happen with EVERY module type or just one of them?

          Show
          Marina Glancy added a comment - sorry, somehow I missed your message about the "add module" button. From what you say it should be absolutely the same if activitychooser is off. Which module are you trying to add when you get this error? Does it happen with EVERY module type or just one of them?
          Hide
          Andrew Nicols added a comment -

          [N] Syntax
          [-] Output
          [Y] Whitespace
          [-] Language
          [-] Databases
          [N] Testing
          [N] Security
          [-] Documentation
          [Y] Git
          [Y] Sanity check

          Syntax/Security:

          • It should be more efficient to assign the node.one result to a new variable and re-use that rather than test it, and fetch it multiple times.
          • Please don't use M.str directly - use M.util.get_string()
          • It would be much better to create the new node (moveto) and then use the setAttribute/setAttrs functions to set the contents. These should handle escaping correctly for you:
            moveto.setAttrs({
              innerHTML: M.util.get_string('dockblock', 'block', header.get('innerHTML'),
              alt: M.util.get_string('addtodock', 'block')
            });
            

          or something to this effect.

          Testing:

          Please cover the reverse cases to check for regressions too.
          Probably worth suggesting adding various HTML content to the block title to check that the HTML content is correctly handled too.

          Show
          Andrew Nicols added a comment - [N] Syntax [-] Output [Y] Whitespace [-] Language [-] Databases [N] Testing [N] Security [-] Documentation [Y] Git [Y] Sanity check Syntax/Security: It should be more efficient to assign the node.one result to a new variable and re-use that rather than test it, and fetch it multiple times. Please don't use M.str directly - use M.util.get_string() It would be much better to create the new node (moveto) and then use the setAttribute/setAttrs functions to set the contents. These should handle escaping correctly for you: moveto.setAttrs({ innerHTML: M.util.get_string('dockblock', 'block', header.get('innerHTML'), alt: M.util.get_string('addtodock', 'block') }); or something to this effect. Testing: Please cover the reverse cases to check for regressions too. Probably worth suggesting adding various HTML content to the block title to check that the HTML content is correctly handled too.
          Hide
          Andrew Nicols added a comment -

          Actually, it would be better to write it more like:

          var moveto = Y.Node.create('<input.....>'),
              header = Y.one('.header .title h2');
          
          moveto.setAttribute('alt', ....);
          if (header) {
            moveto.setAttribute('title', ...);
          } else {
            moveto.setAttribute('title', ...);
          }
          

          This avoids duplication.

          Show
          Andrew Nicols added a comment - Actually, it would be better to write it more like: var moveto = Y.Node.create('<input.....>'), header = Y.one('.header .title h2'); moveto.setAttribute('alt', ....); if (header) { moveto.setAttribute('title', ...); } else { moveto.setAttribute('title', ...); } This avoids duplication.
          Hide
          Jason Fowler added a comment -

          Thanks Andrew, I will implement this ASAP.

          Show
          Jason Fowler added a comment - Thanks Andrew, I will implement this ASAP.
          Hide
          Richard Jones added a comment -

          Marina - using the Afterburner theme with slight mods to default.php and a couple of style sheets.

          With the activity chooser on, selecting any radio button then the Add button generates the error. With the drop-down lists on instead, the correct resource/activity dialog appears.

          Show
          Richard Jones added a comment - Marina - using the Afterburner theme with slight mods to default.php and a couple of style sheets. With the activity chooser on, selecting any radio button then the Add button generates the error. With the drop-down lists on instead, the correct resource/activity dialog appears.
          Hide
          Jason Fowler added a comment -

          Andrew: re testing, that was all tested during the linked issue, this seems to be a regression of that, maybe, I am still not 100% sure what the cause of this issue is. Marina and Richard need to sort that out.

          Show
          Jason Fowler added a comment - Andrew: re testing, that was all tested during the linked issue, this seems to be a regression of that, maybe, I am still not 100% sure what the cause of this issue is. Marina and Richard need to sort that out.
          Hide
          Jason Fowler added a comment -

          Fixed that up now, just waiting on a definite answer on the cause of the issue at hand.

          Show
          Jason Fowler added a comment - Fixed that up now, just waiting on a definite answer on the cause of the issue at hand.
          Hide
          Marina Glancy added a comment -

          Andrew Nicols we need your help. what can be causing the issue, what can we ask Richard to test? I'm really confused. Nobody can reproduce it.

          Richard, did you try activitychooser on the same courses on standard theme without any modifications? (Even though I doubt that default.php can affect the activity chooser...)

          Show
          Marina Glancy added a comment - Andrew Nicols we need your help. what can be causing the issue, what can we ask Richard to test? I'm really confused. Nobody can reproduce it. Richard, did you try activitychooser on the same courses on standard theme without any modifications? (Even though I doubt that default.php can affect the activity chooser...)
          Hide
          Andrew Nicols added a comment -

          Richard Jones, could you provide a little more information on how to replicate this. I've tried:

          • using standard theme and anomaly
          • adding an HTML block without a title
          • stock 2.5 install

          In answer to your earlier question, the lack of activity chooser link is a symptom of the issue, rather than a cause. Something else on the page is causing this issue for you.

          I do however notice that I'm not able to replicate any issue with the empty HTML block title either - it seems that the initialise_block JS code in dock.js is never called from the block I'm testing witih - not quite sure why yet.

          Show
          Andrew Nicols added a comment - Richard Jones , could you provide a little more information on how to replicate this. I've tried: using standard theme and anomaly adding an HTML block without a title stock 2.5 install In answer to your earlier question, the lack of activity chooser link is a symptom of the issue, rather than a cause. Something else on the page is causing this issue for you. I do however notice that I'm not able to replicate any issue with the empty HTML block title either - it seems that the initialise_block JS code in dock.js is never called from the block I'm testing witih - not quite sure why yet.
          Hide
          Richard Jones added a comment -

          I just tried it using standard theme with the same result - using the Activity Chooser results in an error no matter what activity/resource you try to add. Using the drop-down lists works.

          I think the empty html block issue was an anomaly of some kind - it has not come back.

          It has just occurred to me that we modified code (should have mentioned this A LOT earlier) - we removed the old Moodle 2.2 assignments except for the Mahara that we still use from 2.2. That's really the only mod we have but thinking about it now I should put back the original code for all 2.2 assignments. I might pop in now (after work) and try that.

          If that's the problem I am going to be somewhat red-faced. It would explain why only a very few reports of this issue have come up in the forums.

          Show
          Richard Jones added a comment - I just tried it using standard theme with the same result - using the Activity Chooser results in an error no matter what activity/resource you try to add. Using the drop-down lists works. I think the empty html block issue was an anomaly of some kind - it has not come back. It has just occurred to me that we modified code (should have mentioned this A LOT earlier) - we removed the old Moodle 2.2 assignments except for the Mahara that we still use from 2.2. That's really the only mod we have but thinking about it now I should put back the original code for all 2.2 assignments. I might pop in now (after work) and try that. If that's the problem I am going to be somewhat red-faced. It would explain why only a very few reports of this issue have come up in the forums.
          Hide
          Richard Jones added a comment - - edited

          Phew! Put the old file back - same problem. Well, when I say phew I mean thankful it wasn't something stupid I did (afaik).

          Show
          Richard Jones added a comment - - edited Phew! Put the old file back - same problem. Well, when I say phew I mean thankful it wasn't something stupid I did (afaik).
          Hide
          Doug Moody added a comment -

          I have been lurking on this issue. But just so everyone knows, I have a standard 2.5 install, Apache distributed server. Afterburner theme. This ssue has been with me since I installed 2.5. It is impossible for me to add an activity or resource. I have no workaround. So yes, it does not work. Just verifying that its (to me) a major bug.

          Show
          Doug Moody added a comment - I have been lurking on this issue. But just so everyone knows, I have a standard 2.5 install, Apache distributed server. Afterburner theme. This ssue has been with me since I installed 2.5. It is impossible for me to add an activity or resource. I have no workaround. So yes, it does not work. Just verifying that its (to me) a major bug.
          Hide
          Doug Moody added a comment -

          PS. I never had a block without a header, so it must have just been coincidental. The title of this tracker is misleading.

          Show
          Doug Moody added a comment - PS. I never had a block without a header, so it must have just been coincidental. The title of this tracker is misleading.
          Hide
          Richard Jones added a comment -

          OK. Just upgraded Moodle to the latest release. Did not copy any custom themes or anything else - appears to work normally. The Activity Chooser issue appears to be gone. Doesn't matter if I have it on or off (drop down lists also work).

          To do: will re-install custom theme, turnitintool and anything else that I have custom to locate the culprit if one exists.

          Show
          Richard Jones added a comment - OK. Just upgraded Moodle to the latest release. Did not copy any custom themes or anything else - appears to work normally. The Activity Chooser issue appears to be gone. Doesn't matter if I have it on or off (drop down lists also work). To do: will re-install custom theme, turnitintool and anything else that I have custom to locate the culprit if one exists.
          Hide
          Richard Jones added a comment - - edited

          Well, I have re-installed the custom theme, turnitin, the OU question types we had (ddhowtos, ddmarker, ddimageortext and gapselect) and it doesn't appear to be any of those... just added configurable_reports as well, last of the mods I'm going to make.

          Just a mystery to me but problem solved here.

          Show
          Richard Jones added a comment - - edited Well, I have re-installed the custom theme, turnitin, the OU question types we had (ddhowtos, ddmarker, ddimageortext and gapselect) and it doesn't appear to be any of those... just added configurable_reports as well, last of the mods I'm going to make. Just a mystery to me but problem solved here.
          Hide
          Richard Jones added a comment -

          Sorry Doug

          Show
          Richard Jones added a comment - Sorry Doug
          Hide
          Marina Glancy added a comment -

          Doug, re the issue title. Originally it was called "unable to add modules using activity chooser". If you look at the original issue description, there were two cases. We found what caused the first one, it was block without header and also it seems to be appearing only after upgrade. BTW Jason has already prepared a patch and we need to submit it for integration ASAP.

          We are still trying to find what causes the second case. Unfortunately not very successful so far, developers can not reproduce it.

          I suggest that Jason submits this issue for integration now with his blocks patch and meanwhile we can continue discussing the reasons for the second case. If we find it and it's a moodle bug, we will create a new issue. Andrew Nicols, Richard Jones, Jason Fowler - do you agree with it? Andrew, can you please peer review Jason's patch?

          Show
          Marina Glancy added a comment - Doug, re the issue title. Originally it was called "unable to add modules using activity chooser". If you look at the original issue description, there were two cases. We found what caused the first one, it was block without header and also it seems to be appearing only after upgrade. BTW Jason has already prepared a patch and we need to submit it for integration ASAP. We are still trying to find what causes the second case. Unfortunately not very successful so far, developers can not reproduce it. I suggest that Jason submits this issue for integration now with his blocks patch and meanwhile we can continue discussing the reasons for the second case. If we find it and it's a moodle bug, we will create a new issue. Andrew Nicols , Richard Jones , Jason Fowler - do you agree with it? Andrew, can you please peer review Jason's patch?
          Hide
          Jason Fowler added a comment -

          Totally agree Marina, with one slight deviation, we raise a new issue, and research it, if it is a moodle bug, we fix it, if not, then we close it as "Not a Bug" ... that allows us to stay on top of the issue.

          Show
          Jason Fowler added a comment - Totally agree Marina, with one slight deviation, we raise a new issue, and research it, if it is a moodle bug, we fix it, if not, then we close it as "Not a Bug" ... that allows us to stay on top of the issue.
          Hide
          John Porten added a comment -

          We were able to reproduce the bug reported by Doug Moody.

          To recap: After upgrading to 2.5, the Activity Chooser link (+Add an activity or resource) was not working.

          What we found: A JS error occurs when the Navigation Block configuration option "Generate navigation for the following" is set to "Categories, courses, and course structures". The other options do not cause the error and the Activity Chooser link functions normally.

          Show
          John Porten added a comment - We were able to reproduce the bug reported by Doug Moody. To recap: After upgrading to 2.5, the Activity Chooser link (+Add an activity or resource) was not working. What we found: A JS error occurs when the Navigation Block configuration option "Generate navigation for the following" is set to "Categories, courses, and course structures". The other options do not cause the error and the Activity Chooser link functions normally.
          Hide
          Marina Glancy added a comment -

          Thanks a lot John, I created an issue MDL-40142

          Show
          Marina Glancy added a comment - Thanks a lot John, I created an issue MDL-40142
          Hide
          Richard Jones added a comment -

          Happy to go along with that but a search for "generate" or "navigation" does not reveal the location of this setting in the admin menu. Just curious to know where it is in case I can help someone else?

          Show
          Richard Jones added a comment - Happy to go along with that but a search for "generate" or "navigation" does not reveal the location of this setting in the admin menu. Just curious to know where it is in case I can help someone else?
          Hide
          Marina Glancy added a comment -

          sorry Richard, what exactly are referring to as "that" when you say "happy to go along with that"?

          Show
          Marina Glancy added a comment - sorry Richard, what exactly are referring to as "that" when you say "happy to go along with that"?
          Hide
          Richard Jones added a comment -

          Happy to go along with the suggestion you made directly to me and asked if I agreed with.

          Still unable to locate option "Generate navigation for the following". Where is it?

          Show
          Richard Jones added a comment - Happy to go along with the suggestion you made directly to me and asked if I agreed with. Still unable to locate option "Generate navigation for the following". Where is it?
          Hide
          Marina Glancy added a comment -

          oh, all right. Sorry I was a little confused
          I created an issue MDL-40142 and Sam has already fixed it.

          Switch the editing mode on, and you will see that more buttons are displayed for each block. One of them is called "settings" or "configuration". Click on it for navigation block, expand all sections of the form and you will see it.

          Show
          Marina Glancy added a comment - oh, all right. Sorry I was a little confused I created an issue MDL-40142 and Sam has already fixed it. Switch the editing mode on, and you will see that more buttons are displayed for each block. One of them is called "settings" or "configuration". Click on it for navigation block, expand all sections of the form and you will see it.
          Hide
          Richard Jones added a comment -

          Huh! Never noticed that before in 2 1/2 years working with Moodle 2 Thanks.

          Show
          Richard Jones added a comment - Huh! Never noticed that before in 2 1/2 years working with Moodle 2 Thanks.
          Hide
          Andrew Nicols added a comment -

          That looks good to me now thanks Jason.

          Show
          Andrew Nicols added a comment - That looks good to me now thanks Jason.
          Hide
          Jason Fowler added a comment -

          Integrators, this will cherry pick cleanly back to 2.5 too.

          Show
          Jason Fowler added a comment - Integrators, this will cherry pick cleanly back to 2.5 too.
          Hide
          Sam Hemelryk added a comment -

          Thanks guys, this has been integrated now.

          Show
          Sam Hemelryk added a comment - Thanks guys, this has been integrated now.
          Hide
          Andrew Davis added a comment -

          Attaching a screenshot. Is the non-escaped quotes sufficient reason to fail this or shall I open a new MDL?

          https://tracker.moodle.org/secure/attachment/33090/quoteyBlockTitle.png

          The block title is...

          before"double'single'double"after

          Show
          Andrew Davis added a comment - Attaching a screenshot. Is the non-escaped quotes sufficient reason to fail this or shall I open a new MDL? https://tracker.moodle.org/secure/attachment/33090/quoteyBlockTitle.png The block title is... before"double'single'double"after
          Hide
          Jason Fowler added a comment -

          That's just how html.escape() does it - It's been like that before this patch was introduced.

          Show
          Jason Fowler added a comment - That's just how html.escape() does it - It's been like that before this patch was introduced.
          Hide
          Andrew Davis added a comment -

          Passing. I've raised two new MDLs.

          Show
          Andrew Davis added a comment - Passing. I've raised two new MDLs.
          Hide
          Erik Ordway added a comment -

          I have also found in this mornings (PST) a bug the JS the causes this where the code reads s.get instead of this.get. This showed up in firefox debuging. https://github.com/eriko/moodle/commit/6d6c2138b6667e2f1ac73ad159b8cc07b7121263 After making the change and purging cache the activity adder works again.

          Show
          Erik Ordway added a comment - I have also found in this mornings (PST) a bug the JS the causes this where the code reads s.get instead of this.get. This showed up in firefox debuging. https://github.com/eriko/moodle/commit/6d6c2138b6667e2f1ac73ad159b8cc07b7121263 After making the change and purging cache the activity adder works again.
          Hide
          Sam Hemelryk added a comment -

          Hi Erik,

          That appears to be a separate bug.
          Could you please create a new bug report and provide details about the error you got.
          In regards to your change I'd need to look at it properly however it appears it would use the same id for all branches which would lead to the trouble loading content by AJAX.
          As a heads up the build files shouldn't be modified manually, instead in this case we'd modify blocks/navigation/yui/src/navigation/js/navigation.js and then use shifter to build it.
          You can read more about that in our docs if you are interested: http://docs.moodle.org/dev/YUI/Shifter

          Many thanks
          Sam

          Show
          Sam Hemelryk added a comment - Hi Erik, That appears to be a separate bug. Could you please create a new bug report and provide details about the error you got. In regards to your change I'd need to look at it properly however it appears it would use the same id for all branches which would lead to the trouble loading content by AJAX. As a heads up the build files shouldn't be modified manually, instead in this case we'd modify blocks/navigation/yui/src/navigation/js/navigation.js and then use shifter to build it. You can read more about that in our docs if you are interested: http://docs.moodle.org/dev/YUI/Shifter Many thanks Sam
          Hide
          Erik Ordway added a comment -

          There was a comment or two about this happening outside of the block issue. I have found an issue with the minified version of navigation.js that does not effect the debug and un compressed versions. I have reported this here. MDL-40216

          Show
          Erik Ordway added a comment - There was a comment or two about this happening outside of the block issue. I have found an issue with the minified version of navigation.js that does not effect the debug and un compressed versions. I have reported this here. MDL-40216
          Hide
          Andrew Nicols added a comment - - edited

          Erik Ordway Also, please note that changing to this.get is not the correct fix for this issue - the 'this' object refers to the tree, whilst 's' is the new branch. The use of the letter 's' in the variable name is a factor of the minification.

          Show
          Andrew Nicols added a comment - - edited Erik Ordway Also, please note that changing to this.get is not the correct fix for this issue - the 'this' object refers to the tree, whilst 's' is the new branch. The use of the letter 's' in the variable name is a factor of the minification.
          Hide
          Dan Poltawski added a comment -

          Thanks for your contributions!

          _main:
          @ BB#0:
                  push    {r7, lr}
                  mov     r7, sp
                  sub     sp, #4
                  movw    r0, :lower16:(L_.str-(LPC0_0+4))
                  movt    r0, :upper16:(L_.str-(LPC0_0+4))
          LPC0_0:
                  add     r0, pc
                  bl      _printf
                  movs    r1, #0
                  movt    r1, #0
                  str     r0, [sp]                @ 4-byte Spill
                  mov     r0, r1
                  add     sp, #4
                  pop     {r7, pc}
          
                  .section        __TEXT,__cstring,cstring_literals
          L_.str:                                 @ @.str
                  .asciz   "This code is now upstream!"
          
          Show
          Dan Poltawski added a comment - Thanks for your contributions! _main: @ BB#0: push {r7, lr} mov r7, sp sub sp, #4 movw r0, :lower16:(L_.str-(LPC0_0+4)) movt r0, :upper16:(L_.str-(LPC0_0+4)) LPC0_0: add r0, pc bl _printf movs r1, #0 movt r1, #0 str r0, [sp] @ 4- byte Spill mov r0, r1 add sp, #4 pop {r7, pc} .section __TEXT,__cstring,cstring_literals L_.str: @ @.str .asciz "This code is now upstream!"

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Agile