Bug fix for cache and custom helpers
Permalink
I've got lots of custom helpers, as well as overrides of core helpers for a site I'm working on. However, whenever I turned on the cache, C5 would crash. I traced it to the Loader::helper() method. Apparently this method gets called when unserializing objects from the cache. When my site helpers were being unserialized, C5 was looking for a class called 'site_form' instead of 'form' in the site folder. Adding the following to line 202 of /root/concrete/libraries/loader.php fixes the problem:
$file = preg_replace('/^site_/', '', $file);
I haven't tested extensively, but it seems to be working OK right now.
The only thing it might disrupt is overidden helpers in packages (since the package name gets stuck at the front, and that regex doesn't expect anything before 'site_'). Maybe the core team can figure out exactly what this should be.
$file = preg_replace('/^site_/', '', $file);
I haven't tested extensively, but it seems to be working OK right now.
The only thing it might disrupt is overidden helpers in packages (since the package name gets stuck at the front, and that regex doesn't expect anything before 'site_'). Maybe the core team can figure out exactly what this should be.
Change this:
to this
I would think that should do it.