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

Adding specific HTML into Assignment description crashes uploading of files.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.9.6
    • Fix Version/s: None
    • Component/s: Assignment
    • Labels:
    • Affected Branches:
      MOODLE_39_STABLE

      Description

      Problem:

      Adding specific HTML code in description of new mod_assign will cause to throw error when somebody will open "Edit submission" page.

      How to reproduce:

      1. Create new Assignment
      2. Add this HTML code into description 

      <div id="assign_files_tree601d7f049a3191">
          <div id="ygtv0">
              <div id="ygtvc0">
                  <div id="ygtv1"><br></div>
              </div>
          </div>
      </div>

             3. Upload one file ( no matter what )

      4. Login as user and try to submit a new file.

      5. Error should appear and file-manager will spin endlessly 

       

      Error:

      Uncaught TypeError: Cannot set property 'innerHTML' of null
          at d.expand (yui_combo.php?2in3/2.9.0/build/yui2-treeview/yui2-treeview-min.js&3.17.2/event-simulate/event-simulate-min.js&3.17.2/async-queue/async-queue-min.js&3.17.2/gesture-simulate/gesture-simulate-min.js&3.17.2/node-event-simulate/node-event-simulate-min.js:11)
          at YAHOO.widget.RootNode.expandAll (yui_combo.php?2in3/2.9.0/build/yui2-treeview/yui2-treeview-min.js&3.17.2/event-simulate/event-simulate-min.js&3.17.2/async-queue/async-queue-min.js&3.17.2/gesture-simulate/gesture-simulate-min.js&3.17.2/node-event-simulate/node-event-simulate-min.js:11)
          at YAHOO.widget.TreeView.expandAll (yui_combo.php?2in3/2.9.0/build/yui2-treeview/yui2-treeview-min.js&3.17.2/event-simulate/event-simulate-min.js&3.17.2/async-queue/async-queue-min.js&3.17.2/gesture-simulate/gesture-simulate-min.js&3.17.2/node-event-simulate/node-event-simulate-min.js:10)
          at module.js:1
          at YUI._notify (yui_combo.php?rollup/3.17.2/yui-moodlesimple-min.js:9)
          at yui_combo.php?rollup/3.17.2/yui-moodlesimple-min.js:9
          at YUI._notify (yui_combo.php?rollup/3.17.2/yui-moodlesimple-min.js:9)
          at yui_combo.php?rollup/3.17.2/yui-moodlesimple-min.js:9
          at YUI._notify (yui_combo.php?rollup/3.17.2/yui-moodlesimple-min.js:9)
          at YUI.T (yui_combo.php?rollup/3.17.2/yui-moodlesimple-min.js:9)

      Code:

      this.renderChildren() is returning empty string

      lib/yuilib/2in3/2.9.0/build/yui2-treeview/yui2-treeview.js:2072

       

      if (!this.childrenRendered) {
       this.getChildrenEl().innerHTML = this.renderChildren();
      } else {
      }
      

       

       

      because "this.children" is empty

       

      lib/yuilib/2in3/2.9.0/build/yui2-treeview/yui2-treeview.js:2390

       

      completeRender: function() {
          var sb = [];
          for (var i=0; i < this.children.length; ++i) {
              // this.children[i].childrenRendered = false;
              sb[sb.length] = this.children[i].getHtml();
          }
       
          this.childrenRendered = true;
       
          return sb.join("");
      },
      

       

        Attachments

        1. admin_assignment.png
          admin_assignment.png
          61 kB
        2. image-2021-04-15-15-12-12-079.png
          image-2021-04-15-15-12-12-079.png
          77 kB
        3. image-2021-04-16-09-48-24-762.png
          image-2021-04-16-09-48-24-762.png
          55 kB
        4. image-2021-04-16-09-49-08-132.png
          image-2021-04-16-09-49-08-132.png
          50 kB
        5. image-2021-04-16-09-51-31-873.png
          image-2021-04-16-09-51-31-873.png
          174 kB
        6. image-2021-04-16-09-52-19-520.png
          image-2021-04-16-09-52-19-520.png
          47 kB
        7. screenshot-1.png
          screenshot-1.png
          81 kB
        8. screenshot-2.png
          screenshot-2.png
          98 kB
        9. teacher_assignment.png
          teacher_assignment.png
          55 kB

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            jakubkleban Jakub Kleban
            Participants:
            Component watchers:
            Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Sujith Haridasan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated: