Overriding/extending a Dashboard Helper
Permalink
Hi,
Overriding a core dashboard helper doesn't seem to work as expected. I'm trying to extend the core dashboard helper found in:
concrete/helpers/concrete/dashboard.php
By placing a new helper file in:
helpers/concrete/dashboard.php
And doing:
class SiteConcreteDashboardHelper extends ConcreteDashboardHelper
This errors out with:
Warning: require_once(/var/www/.../web/concrete/helpers/concrete_dashboard.php): failed to open stream: No such file or directory in /var/www/.../web/concrete/core/libraries/loader.php on line 293
For some reason C5 ignores its own CamelCase rules and looks for a concrete_dashboard.php instead of concrete/dashboard.php ? Am I doing anything wrong, or is it impossible to extend this core dashboard helper at the moment?
Thanks :o)
Overriding a core dashboard helper doesn't seem to work as expected. I'm trying to extend the core dashboard helper found in:
concrete/helpers/concrete/dashboard.php
By placing a new helper file in:
helpers/concrete/dashboard.php
And doing:
class SiteConcreteDashboardHelper extends ConcreteDashboardHelper
This errors out with:
Warning: require_once(/var/www/.../web/concrete/helpers/concrete_dashboard.php): failed to open stream: No such file or directory in /var/www/.../web/concrete/core/libraries/loader.php on line 293
For some reason C5 ignores its own CamelCase rules and looks for a concrete_dashboard.php instead of concrete/dashboard.php ? Am I doing anything wrong, or is it impossible to extend this core dashboard helper at the moment?
Thanks :o)
Hi John,
I solved what I needed to do another way - but it seems like the C5 team hasn't added class stubs for the dashboard helpers like they've done with all the others - so the documented approach couldn't/didn't work in this case.
Thank you for your time, though :o)
I solved what I needed to do another way - but it seems like the C5 team hasn't added class stubs for the dashboard helpers like they've done with all the others - so the documented approach couldn't/didn't work in this case.
Thank you for your time, though :o)
So what's your approach, then???
I got the same issue with the Text Helper, placing text.php inside [root]/helpers/ with the following code:
I also tried
and ...
no dice... :-( So, I'm compelled to hack the core thus defeating the purpose of overrides in the first place. Double :-( :-(
class TextHelper extends Concrete5_Helper_Text { public function someFunction() { } }
I also tried
class SiteTextHelper extends Concrete5_Helper_Text { public function someFunction() { } }
and ...
class SiteTextHelper extends HelperText { public function someFunction() { } }
no dice... :-( So, I'm compelled to hack the core thus defeating the purpose of overrides in the first place. Double :-( :-(
http://www.concrete5.org/documentation/how-tos/developers/overridin...
(Though I have never tried that with the dashboard helper)