Skip to content
Permalink
Browse files

MDL-40096 assign: Prevent js error because uniqid() is not unique.

Use html_writer::random_id instead because it incorporates a static counter.
  • Loading branch information...
damyon committed Dec 9, 2013
1 parent bf6fd02 commit e135e187b482616cc86be82db5f5e320ede3f31b
Showing with 1 addition and 1 deletion.
  1. +1 −1 mod/assign/renderer.php
@@ -55,7 +55,7 @@ public function assign_files(context $context, $userid, $filearea, $component) {
* @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);

0 comments on commit e135e18

Please sign in to comment.
You can’t perform that action at this time.