Moodle
  1. Moodle
  2. MDL-10142

AJAX move functionality not available in Weekly Format when viewing a single section (see screenshot)

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.9
    • Fix Version/s: 1.9.8
    • Component/s: AJAX and JavaScript
    • Labels:
      None
    • Environment:
      Viewing with FF2.0 on WinXP workstation.
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE
    • Rank:
      29401

      Description

      When viewing a single section the ability to grab resources and move them around is not available in the selected section; however, it is possible to move the resources in the top section. When viewing all of the sections then it is possible to grab and move resources around (see attached screenshot).

      1. 20091027sectioncontent_ajax.patch
        3 kB
        Rossiani Wijaya
      1. ajax_patch_not_working_ALL-SECTIONS.jpg
        48 kB
      2. ajax_patch_not_working_SINGLE-SECTIONS.jpg
        122 kB
      3. no-ajax.gif
        15 kB
      4. screenshot-1.jpg
        171 kB
      5. screenshot-2.jpg
        198 kB

        Issue Links

          Activity

          Hide
          Anthony Borrow added a comment -

          Notice the differnece between the top section and the single week section.

          Show
          Anthony Borrow added a comment - Notice the differnece between the top section and the single week section.
          Hide
          Neil Streeter added a comment -

          This is also the case in topics course format on 1.8+ but with one caveat... The Ajax controls are missing if you view any section in single mode (as pictured in the ss) EXCEPT section one... Everything works fine so long as you view section one.

          I don't know if that will help – or not

          Neil

          Show
          Neil Streeter added a comment - This is also the case in topics course format on 1.8+ but with one caveat... The Ajax controls are missing if you view any section in single mode (as pictured in the ss) EXCEPT section one... Everything works fine so long as you view section one. I don't know if that will help – or not Neil
          Hide
          Anthony Borrow added a comment -

          Somewhat related to this issue is that after a while AJAX capabilities are not available. Is there a limit to the number of AJAX enabled objects? It seems after a while the AJAX move button is no longer available. (this is within the weekly view)

          Show
          Anthony Borrow added a comment - Somewhat related to this issue is that after a while AJAX capabilities are not available. Is there a limit to the number of AJAX enabled objects? It seems after a while the AJAX move button is no longer available. (this is within the weekly view)
          Hide
          Mark Stevens added a comment -

          Version 1.8.2+ 2007021520 cannot move weeks or topics. Move buttons appear then disappear when page finishes loading. Anyone working on this because it seems fairly important.

          Show
          Mark Stevens added a comment - Version 1.8.2+ 2007021520 cannot move weeks or topics. Move buttons appear then disappear when page finishes loading. Anyone working on this because it seems fairly important.
          Hide
          Mark Stevens added a comment -

          Deleting the exercise module fixed this for an upgraded test installation, but still not working on our production installation.

          Show
          Mark Stevens added a comment - Deleting the exercise module fixed this for an upgraded test installation, but still not working on our production installation.
          Hide
          Jose Cedeno added a comment -

          The problem is in lib/ajax/ajaxcourse.js . I have a patch available at: http://repo.or.cz/w/moodle-blog-course-format.git?a=commitdiff;h=70b9fa0b37952e61c55c923e3fbe82ea7657263b;hp=d964566ed00b6612344585110b6edab692fdc4cb

          I've tested this fix in the topics format, using FF. The problem was in the logic of js, so it shouldn't be dependent on browser.

          Show
          Jose Cedeno added a comment - The problem is in lib/ajax/ajaxcourse.js . I have a patch available at: http://repo.or.cz/w/moodle-blog-course-format.git?a=commitdiff;h=70b9fa0b37952e61c55c923e3fbe82ea7657263b;hp=d964566ed00b6612344585110b6edab692fdc4cb I've tested this fix in the topics format, using FF. The problem was in the logic of js, so it shouldn't be dependent on browser.
          Hide
          Leo Thiessen added a comment -

          Hi Jose,

          I applied the patch & tested - in my case it doesn't resolve the issue for the "single section" mode nor the "all sections" mode. In the "all-sections" mode, (I'll upload a screenshot), only my quiz' at the very end of the course have ajax icons; interestingly enough, in single mode for that section, the same quiz links do not have ajax. Everything else, in both single/all-sections mode do not have ajax. I'll upload the 2 screenshots.

          Show
          Leo Thiessen added a comment - Hi Jose, I applied the patch & tested - in my case it doesn't resolve the issue for the "single section" mode nor the "all sections" mode. In the "all-sections" mode, (I'll upload a screenshot), only my quiz' at the very end of the course have ajax icons; interestingly enough, in single mode for that section, the same quiz links do not have ajax. Everything else, in both single/all-sections mode do not have ajax. I'll upload the 2 screenshots.
          Hide
          Leo Thiessen added a comment -

          ajax only enabled in last section of course, and only if not in single-section mode (I have applied the patch from comments in this tracker item); before the patch nothing was ajax, I believe...

          Show
          Leo Thiessen added a comment - ajax only enabled in last section of course, and only if not in single-section mode (I have applied the patch from comments in this tracker item); before the patch nothing was ajax, I believe...
          Hide
          Leo Thiessen added a comment -

          patch applied, no ajax, single section mode

          Show
          Leo Thiessen added a comment - patch applied, no ajax, single section mode
          Hide
          Jose Cedeno added a comment -

          Hi Leo,

          Sorry for the lag in response. I completely missed the email notifying me of the new comment. I cannot replicate this issue. Could you send me a backup of a course that is having this problem? That should help me try to reproduce the problem. Also, what web browser are you using? If it's internet explorer which version are you using?

          Thanks,
          Jose

          Show
          Jose Cedeno added a comment - Hi Leo, Sorry for the lag in response. I completely missed the email notifying me of the new comment. I cannot replicate this issue. Could you send me a backup of a course that is having this problem? That should help me try to reproduce the problem. Also, what web browser are you using? If it's internet explorer which version are you using? Thanks, Jose
          Hide
          Leo Thiessen added a comment -

          Hi Jose,

          I tested in FF3.5 on osx, and in IE7or8 (can't remember) in XP-SP3 (virtual machine) - I really tried getting it working as it would really speed up a bunch of repetitive tasks on our end. I can't supply a course backup (clients site), but I could probably get away with doing a screencast type video of the problem on various browsers & send it to your email... would that work? I'm swamped at the moment, but perhaps later next week... let me know if that would work.

          Regards,

          • Leo
          Show
          Leo Thiessen added a comment - Hi Jose, I tested in FF3.5 on osx, and in IE7or8 (can't remember) in XP-SP3 (virtual machine) - I really tried getting it working as it would really speed up a bunch of repetitive tasks on our end. I can't supply a course backup (clients site), but I could probably get away with doing a screencast type video of the problem on various browsers & send it to your email... would that work? I'm swamped at the moment, but perhaps later next week... let me know if that would work. Regards, Leo
          Hide
          Jose Cedeno added a comment -

          Hi Leo,

          Does this problem happen to you when you create a brand new course? Are you using the weekly or weekly css course format? Does the problem happen when you are using the demo.moodle.org site? Does the ajax functionality work for you in test.moodle.org/timeline? What modules or plugins do you have enabled in your site? Do you get a javascript error? Have you tried enabling ajax debug? A screencast wouldn't be helpful because watching the error is not helpful, if I cannot reproduce it. Next week or whenever you have time is good.

          Cheers,
          Jose

          Show
          Jose Cedeno added a comment - Hi Leo, Does this problem happen to you when you create a brand new course? Are you using the weekly or weekly css course format? Does the problem happen when you are using the demo.moodle.org site? Does the ajax functionality work for you in test.moodle.org/timeline? What modules or plugins do you have enabled in your site? Do you get a javascript error? Have you tried enabling ajax debug? A screencast wouldn't be helpful because watching the error is not helpful, if I cannot reproduce it. Next week or whenever you have time is good. Cheers, Jose
          Hide
          Tak Auyeung added a comment -

          I think I found a probably pattern. All the topics that revert to non-AJAX in my case have a non-empty topic label. As soon as I I blanked the content of the topic label and use a separate label in the topic, the AJAX controls came back. This means the problem may have something to do with the logic of processing the topics as Javascript on the client side.

          Show
          Tak Auyeung added a comment - I think I found a probably pattern. All the topics that revert to non-AJAX in my case have a non-empty topic label. As soon as I I blanked the content of the topic label and use a separate label in the topic, the AJAX controls came back. This means the problem may have something to do with the logic of processing the topics as Javascript on the client side.
          Hide
          Tak Auyeung added a comment -

          I found another probable pattern. At least in my case, every topic label that has <ul></ul> renders the topic AJAX disabled. As soon as I removed the <ul> tags, AJAX was back. I suspect some HTML tags are not processed properly in the code that enables AJAX control.

          Show
          Tak Auyeung added a comment - I found another probable pattern. At least in my case, every topic label that has <ul></ul> renders the topic AJAX disabled. As soon as I removed the <ul> tags, AJAX was back. I suspect some HTML tags are not processed properly in the code that enables AJAX control.
          Hide
          Tak Auyeung added a comment -

          The problem is in lib/ajax/section_classes.js, which scans for 'ul' tags to process. The topic label is outside the 'ul' of the entire topic, that's why any <ul> tag in the topic label breaks the code to add AJAX control for that topic. One possible solution is to put the topic label inside the topic <ul> tag.

          Show
          Tak Auyeung added a comment - The problem is in lib/ajax/section_classes.js, which scans for 'ul' tags to process. The topic label is outside the 'ul' of the entire topic, that's why any <ul> tag in the topic label breaks the code to add AJAX control for that topic. One possible solution is to put the topic label inside the topic <ul> tag.
          Hide
          Tak Auyeung added a comment -

          This seemed to fix the problem:

          in lib/ajax/section_classes.js, find the line that says:

          this.resources_ul = this.content_td.getElementsByTagName('ul')[0];

          comment it out, replace it with the following:

          this.resources_ul = this.content_td.getElementsByClassName('section img-text')[0];

          All the topic-level <ul> tags are of the class "section img-text".

          Show
          Tak Auyeung added a comment - This seemed to fix the problem: in lib/ajax/section_classes.js, find the line that says: this.resources_ul = this.content_td.getElementsByTagName('ul') [0] ; comment it out, replace it with the following: this.resources_ul = this.content_td.getElementsByClassName('section img-text') [0] ; All the topic-level <ul> tags are of the class "section img-text".
          Hide
          Leo Thiessen added a comment -

          Tak - I think you've got it - at first glance it appears to resolve part of my issue as well, namely when viewing the entire course ajax is enabled... you rock!

          Jose - I haven't had a chance yet to look at this some more yet - the single section ajax still doesn't work for me with the above fix.

          • Regards.
          Show
          Leo Thiessen added a comment - Tak - I think you've got it - at first glance it appears to resolve part of my issue as well, namely when viewing the entire course ajax is enabled... you rock! Jose - I haven't had a chance yet to look at this some more yet - the single section ajax still doesn't work for me with the above fix. Regards.
          Hide
          Tak Auyeung added a comment -

          You're welcome, Leo! However, I cannot reproduce the symptom of not having AJAX control in single section mode. Did you enable that mode using the "show only ..." icon?

          Show
          Tak Auyeung added a comment - You're welcome, Leo! However, I cannot reproduce the symptom of not having AJAX control in single section mode. Did you enable that mode using the "show only ..." icon?
          Hide
          Rossiani Wijaya added a comment -

          I created a patch to fix the issue(20091027sectioncontent_ajax.patch). Please give it a try and let me know if more issue occur.

          thanks

          Show
          Rossiani Wijaya added a comment - I created a patch to fix the issue(20091027sectioncontent_ajax.patch). Please give it a try and let me know if more issue occur. thanks
          Hide
          Leo Thiessen added a comment -

          Tak: sorry - missed your question to me, just noticed it today - I'll try Rassiani's patch right now & see if it works on my problem site...

          Show
          Leo Thiessen added a comment - Tak: sorry - missed your question to me, just noticed it today - I'll try Rassiani's patch right now & see if it works on my problem site...
          Hide
          Martin Dougiamas added a comment -

          Rosie, can you put this in 1.9 and HEAD please?

          Show
          Martin Dougiamas added a comment - Rosie, can you put this in 1.9 and HEAD please?
          Hide
          Rossiani Wijaya added a comment -

          Commited to 1.9 and HEAD.

          Show
          Rossiani Wijaya added a comment - Commited to 1.9 and HEAD.
          Hide
          Ryan Smith added a comment -

          I updated our installation with the new lib/ajax/ajaxcourse.js and lib/ajax/ajaxlib.php and now items no longer delete in the course. Once you delete something it disappears, but when you turn editing off the item appears again.

          Show
          Ryan Smith added a comment - I updated our installation with the new lib/ajax/ajaxcourse.js and lib/ajax/ajaxlib.php and now items no longer delete in the course. Once you delete something it disappears, but when you turn editing off the item appears again.
          Hide
          Anthony Borrow added a comment -

          Ryan - Thanks for your feedback and help with testing. I realize this may seem a bit silly, but I had a couple of questions. First, did you upgrade completely to the latest version of Moodle or did you just make the suggested changes related to this issue. I would actually encourage testing with the latest version of Moodle. Secondly, if this patch is in fact causing another issue let's go ahead and create a separate issue in the tracker for that as it allows us to keep each tracker issue focused. Peace - Anthony

          Show
          Anthony Borrow added a comment - Ryan - Thanks for your feedback and help with testing. I realize this may seem a bit silly, but I had a couple of questions. First, did you upgrade completely to the latest version of Moodle or did you just make the suggested changes related to this issue. I would actually encourage testing with the latest version of Moodle. Secondly, if this patch is in fact causing another issue let's go ahead and create a separate issue in the tracker for that as it allows us to keep each tracker issue focused. Peace - Anthony
          Hide
          Ryan Smith added a comment -

          I updated from MOODLE19_STABLE this morning. (I update every morning) It fetched 3 new files:

          version.php
          lib/ajax/ajaxcourse.js
          lib/ajax/ajaxlib.php

          I found that deleting was now broken, so I checked:

          http://cvs.moodle.org/moodle/lib/ajax/ajaxcourse.js?view=log

          and it listed that a new version of the file, relating to this bug, was committed recently, so I posted this comment.

          Show
          Ryan Smith added a comment - I updated from MOODLE19_STABLE this morning. (I update every morning) It fetched 3 new files: version.php lib/ajax/ajaxcourse.js lib/ajax/ajaxlib.php I found that deleting was now broken, so I checked: http://cvs.moodle.org/moodle/lib/ajax/ajaxcourse.js?view=log and it listed that a new version of the file, relating to this bug, was committed recently, so I posted this comment.
          Hide
          Anthony Borrow added a comment -

          Ryan - Thanks for clarifying about your upgrade, I wanted to make sure your had the latest version and not simply applied the patch to an earlier version. I tested the latest version as well and while I now I have the ability to move things around I can confirm the behavior you describe. I think we may be able to mark this issue as resolved and continue to comment and work on resolving the behavior you are reporting about deleting on MDL-10221 which seems to be a bit elusive. Thanks again for your help with testing. Peace - Anthony

          Show
          Anthony Borrow added a comment - Ryan - Thanks for clarifying about your upgrade, I wanted to make sure your had the latest version and not simply applied the patch to an earlier version. I tested the latest version as well and while I now I have the ability to move things around I can confirm the behavior you describe. I think we may be able to mark this issue as resolved and continue to comment and work on resolving the behavior you are reporting about deleting on MDL-10221 which seems to be a bit elusive. Thanks again for your help with testing. Peace - Anthony
          Hide
          Leo Thiessen added a comment -

          I tested the latest patch with moodle 1.9.5 on 2 separate servers - ajax mostly worked, but not on this particular course; it stopped after the 1st block (see pic).

          Show
          Leo Thiessen added a comment - I tested the latest patch with moodle 1.9.5 on 2 separate servers - ajax mostly worked, but not on this particular course; it stopped after the 1st block (see pic).
          Hide
          Rossiani Wijaya added a comment -

          Leo - I couldn't re-create the issue. Could you try to update your moodle version to 1.9.6.

          Thank you.

          Show
          Rossiani Wijaya added a comment - Leo - I couldn't re-create the issue. Could you try to update your moodle version to 1.9.6. Thank you.
          Hide
          Leo Thiessen added a comment -

          Hi Rossiani, I'm looking into getting the site upgraded as soon as 1.9.7 comes out - I'll check again after that to see if the problem is resolved on the site in question.

          Show
          Leo Thiessen added a comment - Hi Rossiani, I'm looking into getting the site upgraded as soon as 1.9.7 comes out - I'll check again after that to see if the problem is resolved on the site in question.

            People

            • Votes:
              4 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: