Jump to content

Cache Index missing paths to override classes


micks80

Recommended Posts

PS: 1.6.0.14

 

I have few classes (7) under my overrides folder, some of which I have manually created to get the clean url's mod working but now the classes/cache_index.php is giving me lot of trouble. Whenever the cache is cleared, it regenerates the file with missing paths to the override classes and breaks the whole site. I then have to manually delete it and it re-generates a new one correctly with all the paths.The only way to get it working is to disable cache completely. Here's an example -

 

Bad:

Auto generated by PrestaShop right after clearing the cache:

  'CategoryController' => 
  array (
    'path' => '',
    'type' => 'class',
    'override' => false,
  ),

Good:

Delete the auto-generated cache_index file manually and then PrestaShop re-generates this file which is good:

  'CategoryController' => 
  array (
    'path' => 'override/controllers/front/CategoryController.php',
    'type' => 'class',
    'override' => false,
  ),

 

In the documentation HERE, it's mentioned -

 

But sometimes you need to add that overriding code yourself, manually uploading the file to your server. In that case, you need to trigger the regeneration of the /cache/class_index.php file yourself. This is done simply by deleting the file: if PrestaShop cannot find the file, it will regenerate it, taking all the overrides into account.

 

 

Is there anyway that prestashop can take the override paths into consideration whenever it generates the cache_index file. I am even fine to hard-code the paths in PrestaShopAutoLoad.php if that fixes the issue. 

 

Any hack or proper solution to fix this would be greatly appreciated so that we can enable caching back on our site and improve the user experience.

 

Thanks,

Mick

Edited by micks80 (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...