NemoPS Posted April 8, 2013 Share Posted April 8, 2013 (edited) Hi Everybody, I don't know if this only happened to me, but on a 1.5.4 stable release, I just tried to use an override...and it didn't work. I tried another (productController) and didn't work. i even typed some garbage, and nothing showed up. It looks like overrides re not even being loaded. The path it's okay (override/controllers/front), and I get the same with classes. Anybody got the same bug? Edited April 8, 2013 by Nemo1 (see edit history) Link to comment Share on other sites More sharing options...
remyyyyy Posted April 8, 2013 Share Posted April 8, 2013 Hello Nemo, You should delete the file "class_index.php" in cache folder. 10 Link to comment Share on other sites More sharing options...
NemoPS Posted April 8, 2013 Author Share Posted April 8, 2013 Gosh, they should tell us these things :/ Thank you Link to comment Share on other sites More sharing options...
vekia Posted April 8, 2013 Share Posted April 8, 2013 Now I know why my overrides don't load well haha :| thanks for your attention, it really helped 1 Link to comment Share on other sites More sharing options...
remyyyyy Posted April 8, 2013 Share Posted April 8, 2013 Gosh, they should tell us these things :/ Thank you I completely agree ! Link to comment Share on other sites More sharing options...
Paul C Posted April 8, 2013 Share Posted April 8, 2013 (edited) I noticed this today. You'll notice that all the "empty" override classes from the override directory are gone, which is good as they would overwrite the changes that weren't meant to be overwritten on upgrade.... I think the side-effect though is that changes aren't now being detected in order to recreate the class_index.php file. Just a hunch which I guess I'll have to go and try and work out from the source.... If you install your overrides via a module there shouldn't be a problem though. EDIT: Yup Autoload::load($classname) is now broken and will use the Core class and ignore any subsequent overrides as it has cached the Core class as the non-core declaration.using the following: // Since the classname does not exists (we only have a classCore class), we have to emulate the declaration of this class $class_infos = new ReflectionClass($classname.'Core'); eval(($class_infos->isAbstract() ? 'abstract ' : '').'class '.$classname.' extends '.$classname.'Core {}'); Previously it would have stored the path to the "empty" class declaration in the override directory.... now it stores the path to the core class.... Edited April 8, 2013 by Paul C (see edit history) 1 Link to comment Share on other sites More sharing options...
Paul C Posted April 9, 2013 Share Posted April 9, 2013 I've reported this as a bug PSCFV-8700 Link to comment Share on other sites More sharing options...
Paul C Posted April 9, 2013 Share Posted April 9, 2013 (edited) Just an update for anyone searching for this in the future. Apparently it's INTENDED to work this way (although it hasn't up until 1.5.4 due to those stub files) To be fair it is documented in the new docs for 1.5 overrides. Attached is a modified version of Autoload.php I'm now using in development that makes it behave as it always used to.... life is too short to have to remember to delete a cache file.... It will add a little overhead, so probably best to use the standard in production (but remember that if you patch the production system you'll need to remember to delete the cache file). Paul Edited April 9, 2013 by Paul C (see edit history) Link to comment Share on other sites More sharing options...
AnilaN Posted May 24, 2013 Share Posted May 24, 2013 thanks remyyyy Link to comment Share on other sites More sharing options...
valentin.g Posted June 10, 2013 Share Posted June 10, 2013 is not need to remove class_index.php just put cache off run once your script to check results then put back cacke on. Link to comment Share on other sites More sharing options...
vekia Posted June 10, 2013 Share Posted June 10, 2013 i don't think so, it's really weird, but sometimes, on remote servers, i have to remove this file even if the cache is turned off 1 Link to comment Share on other sites More sharing options...
valentin.g Posted June 10, 2013 Share Posted June 10, 2013 ok I encountered this problem soon and I am not sure if was resolved after I delete file class_index.php or after set this option in BO but is well to know! Link to comment Share on other sites More sharing options...
vekia Posted June 10, 2013 Share Posted June 10, 2013 i think that everything depends on hosting configuration, is hard to say where the problem exactly is, but the most important thing: we know how to deal with it btw. On my localhost your solution works (in latest ps 1.5.4.1) Link to comment Share on other sites More sharing options...
felek Posted July 8, 2013 Share Posted July 8, 2013 Hi i have no idea what i'm doing wrong. i want to override blocktopmenu.php. i want to add some string to every li in menu. i located place line 644 $this->_menu .= '<li '.$selected.' demo>'; in blocktopmenu.php When i put file inside of default module its working great. When i put to over override\controllers\front\blocktopmenu.php its not working i deleted cache\class_index.php still not working and file is not showing again (maybe because i disable cache in preformace) Still no results Any body can help in that ?? Link to comment Share on other sites More sharing options...
NemoPS Posted July 8, 2013 Author Share Posted July 8, 2013 You cannot override a module like that, that's why. Overrides can only be used for controllers and classes atm Link to comment Share on other sites More sharing options...
felek Posted July 8, 2013 Share Posted July 8, 2013 So only solution is to change original file and after update change it again correct ? Link to comment Share on other sites More sharing options...
NemoPS Posted July 8, 2013 Author Share Posted July 8, 2013 Yes, for the time being yes. OR you can clone the module, change all names references, and modify it as you need Link to comment Share on other sites More sharing options...
felek Posted July 8, 2013 Share Posted July 8, 2013 could you please step by step guide to alternative solution. I prefer not to change every presta updates. I never clone module before so no clue were to start ... Link to comment Share on other sites More sharing options...
NemoPS Posted July 8, 2013 Author Share Posted July 8, 2013 A step by step guide for this? it's a bit too long to be added in a forum post. Basically: clone the blocktopmenu folder rename it to blocktopmenu2 in all files in that folder, replace ALL occurrences of 'blocktopmenu' in blocktopmenu2 (including filenames). Rename all the database tables in blocktopmenu2.php Link to comment Share on other sites More sharing options...
felek Posted July 8, 2013 Share Posted July 8, 2013 (edited) ok thx i will try if any error occur i will come back to You for now Big Thx 1 Q module should be placed under modules of main installation not in template ? 2 Q override css will be inside template but name will be blocktopmenu2 folder php ect Edited July 8, 2013 by felek (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted July 8, 2013 Share Posted July 8, 2013 but after module update (with prestashop update) you will have to edit it once again - of course only when the old version of the module will be incompatibile. i think that after nearest update you will have to edit it once again, due to the template change (new version will have got responsive design) Link to comment Share on other sites More sharing options...
felek Posted July 8, 2013 Share Posted July 8, 2013 Responsive that's nice by default Still i'm beginner, in styling that system, some trouble might occur during template. But nice learning possibility's thanks any way for help Link to comment Share on other sites More sharing options...
Ricardo Vigatti Posted August 27, 2013 Share Posted August 27, 2013 Nice, work for me. Link to comment Share on other sites More sharing options...
MEG Venture Posted September 6, 2013 Share Posted September 6, 2013 Is there a way to delete class_index.php automatically, before the installation of the module? Or is it the only way to remove it manually? Thanks. Link to comment Share on other sites More sharing options...
valentin.g Posted September 6, 2013 Share Posted September 6, 2013 you can set cache = off while install module 1 Link to comment Share on other sites More sharing options...
MEG Venture Posted September 6, 2013 Share Posted September 6, 2013 you can set cache = off while install module Thank you. I guess we also need to clear cache for Prestashop 1.5.5 Link to comment Share on other sites More sharing options...
Daniel - PrestaBR Posted September 28, 2013 Share Posted September 28, 2013 Thanks. I had a hard time wondering whats happening with the override. Good job you all. Link to comment Share on other sites More sharing options...
syntaxWiz Posted March 6, 2014 Share Posted March 6, 2014 My problem is that my module's directory & files aren't being saved in my theme's directory I've tried uninstalling this module & deleting the class_index.php file & then reinstall this module, but still no difference. This problem is also preventing me from being able to translate this module... please help!!! Link to comment Share on other sites More sharing options...
syntaxWiz Posted March 6, 2014 Share Posted March 6, 2014 Nevermind, all I had to do was copy my module's entire directory & paste into the theme directory's modules folder Link to comment Share on other sites More sharing options...
vekia Posted March 7, 2014 Share Posted March 7, 2014 you also fixed problem with translations? Link to comment Share on other sites More sharing options...
requ Posted January 27, 2017 Share Posted January 27, 2017 I have problem still. File removed class_index.php from cache. And still blank page with info. PS 1.6.1.1 Link to comment Share on other sites More sharing options...
kirubanidhi Posted July 18, 2017 Share Posted July 18, 2017 I am migrated prestashop 1.5.6 to 1.6.1 version. Migrated work successfully done. I am going to check back-office and its working fine. Then checking front-office its getting some error. Error: Fatal error: Undefined class constant 'ONLY_HAZMAT' in /var/www/html/cy_prestashop/override/classes/Cart.php on line 241 Fatal error: Undefined class constant 'ONLY_POISON' in /var/www/html/cy_prestashop/override/classes/Cart.php on line 241 Fatal error: Undefined class constant 'ONLY_Refrigerated' in /var/www/html/cy_prestashop/override/classes/Cart.php on line 241 How to resolve it. Link to comment Share on other sites More sharing options...
NemoPS Posted July 20, 2017 Author Share Posted July 20, 2017 Broken overrides, what module do they come from? Any idea? You can uninstall the broken module/have it fixed by the developer Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now