Jump to content

http 500 on the brands page after updating


jaimesks

Recommended Posts

after updating from version 1.6 to 1.7.3 the brand pages show me an error http 500

despues de actualizar desde la version 1.6 a 1.7.3 la paginas de marcas me muestran un error http 500

Note: change server and perform an installation from 1.6 to 1.7.3

 

PHP Fatal error:  Uncaught Error: Call to undefined method ManufacturerController::productSort() in /var/www/html/controllers/front/ManufacturerController.php:79\nStack trace:\n#0 /var/www/html/classes/controller/Controller.php(205): ManufacturerControllerCore->initContent()\n#1 /var/www/html/classes/Dispatcher.php(428): ControllerCore->run()\n#2 /var/www/html/index.php(28): DispatcherCore->dispatch()\n#3 {main}\n  thrown in /var/www/html/controllers/front/ManufacturerController.php on line 79, referer: http://demo.com/

 

Link to comment
Share on other sites

  • 3 weeks later...

Hi, any update?

I've the same error, updating from 1.6.x to 1.7.x (actually 1.7.3).

As I can see, productSort() is called from initContent function (inside manufacturer controller):

    /**
     * Assign template vars related to page content
     * @see FrontController::initContent()
     */
    public function initContent()
    {
        parent::initContent();

        if (Validate::isLoadedObject($this->manufacturer) && $this->manufacturer->active && $this->manufacturer->isAssociatedToShop()) {
            $this->productSort();
            $this->assignOne();
            $this->setTemplate(_PS_THEME_DIR_.'manufacturer.tpl');
        } else {
            $this->assignAll();
            $this->setTemplate(_PS_THEME_DIR_.'manufacturer-list.tpl');
        }
    }

But if I comment this line, appears another error in the same Controller: PHP message: PHP Fatal error:  Uncaught Error: Call to undefined method ManufacturerController::pagination(), and pagination is used in many functions, as:

    /**
     * Assign template vars if displaying one manufacturer
     */
    protected function assignOne()
    {
        $this->manufacturer->description = Tools::nl2br(trim($this->manufacturer->description));
        $nbProducts = $this->manufacturer->getProducts($this->manufacturer->id, null, null, null, $this->orderBy, $this->orderWay, true);
        $this->pagination((int)$nbProducts);

        $products = $this->manufacturer->getProducts($this->manufacturer->id, $this->context->language->id, (int)$this->p, (int)$this->n, $$
        $this->addColorsToProductList($products);

        $this->context->smarty->assign(array(
            'nb_products' => $nbProducts,
            'products' => $products,
            'path' => ($this->manufacturer->active ? Tools::safeOutput($this->manufacturer->name) : ''),
            'manufacturer' => $this->manufacturer,
            'comparator_max_item' => Configuration::get('PS_COMPARATOR_MAX_ITEM'),
            'body_classes' => array($this->php_self.'-'.$this->manufacturer->id, $this->php_self.'-'.$this->manufacturer->link_rewrite)
        ));
    }

In my view, this is a problem with any include, but I don't know which.

Regards

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

Hi,

I found the problem.

The problem is the migration tool from 1.6.x to 1.7.x, because there are a lot of controllers that mustn't exist, as:

  • BestSalesController.php
  • CompareController.php
  • NewProductsController.php
  • ParentOrderController.php
  • SearchController.php
  • CategoryController.php
  • ManufacturerController.php
  • OrderOpcController.php
  • PricesDropController.php
  • SupplierController.php

If you delete this controllers (in this case, only the ManufacturerController.php), it works.

It's a bug, i installed a fresh 1.7.3 in my dev environment and compare controllers.

Try it.

Regards

Link to comment
Share on other sites

  • 2 years later...

Hi guys,

I know its an old topic but may be my practice answer helps to someone. In my case:

I upgraded 1.6.x to 1.7.6.5 and I got this error on new-product page. As @clemenlg said the problem is related to controllers, but you don't have to install fresh PS and replace the store.
Basicly do this:

  • Go to /mainFolder/controllers/front directory,
  • compare the controllers with the original PS controllers (same version)
  • for my current-upgraded PS (1.7.6.5) has 41 controllers but original PS 1.7.6.5 has 31 controllers,
  • get a backup and delete or rename this folder and upload the original one.

That's it!

Link to comment
Share on other sites

  • 2 weeks later...

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...