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'; $this->_outputFormat = 'js';
} }
$data['id'] = 'cakeErr' . count($this->errors); $data['id'] = 'cakeErr' . uniqid();
$tpl = array_merge($this->_templates['base'], $this->_templates[$this->_outputFormat]); $tpl = array_merge($this->_templates['base'], $this->_templates[$this->_outputFormat]);
$insert = array('context' => join("\n", $context), 'helpPath' => $this->helpPath) + $data; $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'), 'pre' => array('class' => 'cake-debug'),
'a' => array( 'a' => array(
'href' => "javascript:void(0);", 'href' => "javascript:void(0);",
'onclick' => "document.getElementById('cakeErr9-trace').style.display = " . 'onclick' => "preg:/document\.getElementById\('cakeErr[a-z0-9]+\-trace'\)\.style\.display = " .
"(document.getElementById('cakeErr9-trace').style.display == 'none'" . "\(document\.getElementById\('cakeErr[a-z0-9]+\-trace'\)\.style\.display == 'none'" .
" ? '' : 'none');" " \? '' \: 'none'\);/"
), ),
'b' => array(), 'Notice', '/b', ' (8)', 'b' => array(), 'Notice', '/b', ' (8)',
)); ));