Home
Documentation
Downloads
Demo
Tracker
Development
Translation
Moodle.net
Search
projects
/
moodle.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c36a240
)
MDL-40096 assign: Prevent js error because uniqid() is not unique.
author
Damyon Wiese
<damyon@moodle.com>
Mon, 9 Dec 2013 02:24:17 +0000
(10:24 +0800)
committer
Damyon Wiese
<damyon@moodle.com>
Mon, 9 Dec 2013 02:25:15 +0000
(10:25 +0800)
Use html_writer::random_id instead because it incorporates a static counter.
mod/assign/renderer.php
patch
|
blob
|
blame
|
history
diff --git
a/mod/assign/renderer.php
b/mod/assign/renderer.php
index
f9058c8
..
7403917
100644
(file)
--- a/
mod/assign/renderer.php
+++ b/
mod/assign/renderer.php
@@
-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);