mirror of
https://github.com/moodle/moodle.git
synced 2025-08-06 17:36:38 +02:00
MDL-40096 assign: Prevent js error because uniqid() is not unique.
Use html_writer::random_id instead because it incorporates a static counter.
This commit is contained in:
parent
c36a2401ab
commit
9a046c0683
1 changed files with 1 additions and 1 deletions
|
@ -55,7 +55,7 @@ class mod_assign_renderer extends plugin_renderer_base {
|
|||
* @return string
|
||||
*/
|
||||
public function render_assign_files(assign_files $tree) {
|
||||
$this->htmlid = 'assign_files_tree_'.uniqid();
|
||||
$this->htmlid = html_writer::random_id('assign_files_tree');
|
||||
$this->page->requires->js_init_call('M.mod_assign.init_tree', array(true, $this->htmlid));
|
||||
$html = '<div id="'.$this->htmlid.'">';
|
||||
$html .= $this->htmllize_tree($tree, $tree->dir);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue