Permalink
Browse files

Merge pull request #27 from msadouni/fix-helper-loading

Fix helper loading : prevent a custom aliased Number helper from being overwritten by the Core one.
  • Loading branch information...
2 parents 61e959e + 12a8716 commit 09b71354a5f9f92f978d732763dae837799cdae8 @markstory markstory committed Nov 25, 2011
Showing with 3 additions and 2 deletions.
  1. +3 −2 Controller/Component/ToolbarComponent.php
@@ -4,6 +4,7 @@
App::uses('CakeLogInterface', 'Log');
App::uses('DebugTimer', 'DebugKit.Lib');
App::uses('DebugMemory', 'DebugKit.Lib');
+App::uses('HelperCollection', 'View');
/**
* DebugKit DebugToolbar Component
@@ -589,10 +590,10 @@ class TimerPanel extends DebugPanel {
* @return void
**/
public function startup($controller) {
- if (!in_array('Number', $controller->helpers)) {
+ if (!in_array('Number', array_keys(HelperCollection::normalizeObjectArray($controller->helpers)))) {
$controller->helpers[] = 'Number';
}
- if (!in_array('SimpleGraph', $controller->helpers)) {
+ if (!in_array('SimpleGraph', array_keys(HelperCollection::normalizeObjectArray($controller->helpers)))) {
$controller->helpers[] = 'DebugKit.SimpleGraph';
}
}

0 comments on commit 09b7135

Please sign in to comment.