Jump to content

Overriding issue in Prestashop 1.6.0.11 and 1.6.0.12


Recommended Posts

I am trying to override core prestashop files in 1.6.0.9 and it was working fine but it is not working 1.6.0.11 or 1.6.0.12 even i have changed the core files now i am using files of new version but still its not working . It is Showing error ...

 

The following module(s) could not be installed properly:

  • marketplace :
        Unable to install override: Class AdminControllerOverride54ec51e02407e does not exist

 

post-891562-0-81539500-1424775132_thumb.png

Edited by PRashant PUrohit (see edit history)
  • Like 2
Link to comment
Share on other sites

Without seeing the actual override file and knowing what you did, it is quite impossible to help you.

Actually I am changing a query.... 

 

in function getList() of AdminController

 

** Actual Query

$this->_listsql = '

            SELECT SQL_CALC_FOUND_ROWS

            '.($this->_tmpTableFilter ? ' * FROM (SELECT ' : '');

 

**My Query

$this->_listsql = '

            SELECT DISTINCT SQL_CALC_FOUND_ROWS

            '.($this->_tmpTableFilter ? ' * FROM (SELECT ' : '');

 

This is done to restrict the view of orders in admin login for another user...

Edited by PRashant PUrohit (see edit history)
  • Like 1
Link to comment
Share on other sites

I am trying to override core prestashop files in 1.6.0.9 and it was working fine but it is not working 1.6.0.11 or 1.6.0.12 even i have changed the core files now i am using files of new version but still its not working . It is Showing error ...

 

The following module(s) could not be installed properly:

  • marketplace :

        Unable to install override: Class AdminControllerOverride54ec51e02407e does not exist

 

attachicon.giferror.PNG

 

I am also getting same problem. my problem in classes ovverride. How to override classes file

Link to comment
Share on other sites

Well there are 1 of 3 things occuring

 

1) You are not creating the overrides properly.

2) .12 or .13 has changed the way overrides work and we will need to wait for Prestashop to document this

3) .12 or .13 has created yet again, more defects and broke how overrides work

 

To resolve

1) do your homework and read the documentation in the "Learn" menu. 

2) not much we can do but wait or try to figure it out

3) report your issue to Prestashop using their Forge and then wait and see

 

I suspect the issue is #3, but neither of you have provided your override classes, so I can't rule out #1

Link to comment
Share on other sites

Without seeing the actual override file and knowing what you did, it is quite impossible to help you.

 

 

Same Error occured for me. I only wrote "HELLO" in AdminController to see whether it works or not, but everytime it shows same error..please help

 

 

I am also getting same problem. my problem in classes ovverride. How to override classes file

 

Hello Friends,

Finally Some changes in overriding behavior.

Overriding a class

In order to override the Product class, your file needs to be called Product.php and must feature a Product class that then extends ProductCore class.

The file can be placed in either of these locations:

  • /override/classes/Product.php
  • /modules/my_module/override/classes/Product.php
Overriding a controller

In order to override the ProductController class, your file needs to be called ProductController.php and must feature a ProductController class that then extends ProductControllerCore class.

The file can be placed in either of these locations:

  • /override/controllers/front/ProductController.php
  • /modules/my_module/override/controllers/front/ProductController.php

 

Even now you can override .tpl file of nay other module...

http://doc.prestashop.com/display/PS16/Overriding+default+behaviors

Link to comment
Share on other sites

none of that is new information.  that is the way you override classes and controllers since they implemented overridesllini

 

Hello Bellini,

In Prestashop 1.6.0.9 it is possible to override core file without following this way of overriding, you can try put any core file in override folder of your module without making any change it will be overriden easily but in version 0.11, 0.12 and 0.13 it will not work in these versions you have to override file like this,

 

class AdminProductsController extends AdminProductsControllerCore

{

     ..

     ...

     ..

}

 

But problem is that it worked for me once when i installed it, after unintalling i tried to install it again now it is showing that old error.

Unable to install override: Class AdminProductsControllerOverride54ec51e02407e does not exist "

 

One more thing please try to override AdminProductsController without making any change it will throw you an error of bad sql query if it will be installed.

  • Like 1
Link to comment
Share on other sites

you don't need to instruct me on how to create overrides.  My only point is that you are trying to document how overrides already work.  And this is already documented in the Prestashop developer's guide.  Nothing you have said is new.

 

If you have discovered a defect in .11, .12 and .13, then I would suggest you open a forge issue so that prestashop can review and fix the issue.  They do not read the forums...

Link to comment
Share on other sites

  • 1 year later...

I had a very similar issue / error as I was trying to install my first module that uses an override. For me, it turned out to be a simple fix: The naming of the class is very specific and must be correct. Working to override getPackageList method for exaple in Cart.php this worked:

class Cart extends CartCore
{
    public function getPackageList($flush = false)
    {
        parent::getPackageList();

The basic idea I think is that your class declaration for the class that you are overriding ends up being named the same as the file name, which obviously makes sense... but which is not the case if you've simply copied the original file over to the override folder as I'd done :-) since in that file the class is called CartCore.

Edited by amoswright (see edit history)
  • Like 1
Link to comment
Share on other sites

  • 1 year later...

In my case this error was for <?PHP declaration in my module controller, you must use <?php  

The issue is in classes/module/ModuleCore class in addOverride method at the line :

  eval(preg_replace(array('#^\s*<\?(?:php)?#', '#class\s+'.$classname.'\s+extends\s+([a-z0-9_]+)(\s+implements\s+([a-z0-9_]+))?#i'), array(' ', 'class '.$classname.'OverrideOriginal'.$uniq), implode('', $override_file))); 

eval code  fall when you use <?PHP or <?Php why preg_replace pattern is case sensitive.

 

 

 

  • Like 1
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...