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

Submission comments get the same id and don't load

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Minor Minor
    • None
    • 2.9
    • Comments
    • None
    • MOODLE_29_STABLE

      We have a problem where the drop down to display Submission comments in the gradebook won't work for one or more random assignment: it just bring the browser at the page top instead of displaying the ajax loader. Refreshing the page change which assignment having the problem.

      I found out that the problematic comments get the same id as its predecessor, so based on Damyon comment in https://tracker.moodle.org/browse/MDL-40096, I edited \comment\lib.php and changed the call from uniqid() to html_writer:random_id() in the constructor. So far so good, it seem to have resolved the problem.

          public function __construct(stdClass $options) {
              $this->viewcap = false;
              $this->postcap = false;
       
              // setup client_id
              if (!empty($options->client_id)) {
                  $this->cid = $options->client_id;
              } else {
                  $this->cid = html_writer::random_id(); //uniqid(); <-- change here
              }
      [...]
      

            Unassigned Unassigned
            jackdaniels JD
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.