Fixing non-unique id's being generated for Debugger rendered errors.

This commit is contained in:
mark_story 2011-05-04 23:30:24 -04:00
parent e857387a8e
commit bd30510e87
2 changed files with 4 additions and 4 deletions

View file

@ -607,7 +607,7 @@ class Debugger {
$this->_outputFormat = 'js';
}
$data['id'] = 'cakeErr' . count($this->errors);
$data['id'] = 'cakeErr' . uniqid();
$tpl = array_merge($this->_templates['base'], $this->_templates[$this->_outputFormat]);
$insert = array('context' => join("\n", $context), 'helpPath' => $this->helpPath) + $data;

View file

@ -145,9 +145,9 @@ class DebuggerTest extends CakeTestCase {
'pre' => array('class' => 'cake-debug'),
'a' => array(
'href' => "javascript:void(0);",
'onclick' => "document.getElementById('cakeErr9-trace').style.display = " .
"(document.getElementById('cakeErr9-trace').style.display == 'none'" .
" ? '' : 'none');"
'onclick' => "preg:/document\.getElementById\('cakeErr[a-z0-9]+\-trace'\)\.style\.display = " .
"\(document\.getElementById\('cakeErr[a-z0-9]+\-trace'\)\.style\.display == 'none'" .
" \? '' \: 'none'\);/"
),
'b' => array(), 'Notice', '/b', ' (8)',
));