Jump to content

Possible bug on Product Attributes list pagination in 1.6.1.6


Glauber

Recommended Posts

Hi,

 

recently I noticed a weird behaviour on product attribute list pagination. The problem was catch with the steps:

 

1) Click on Catalog > Product Attributes

2) I have a Color attribute with 93 values, so I click on "Show" action

3) On Color values list I click on the second page link

4) Prestashop returns to Catalog > Product Attributes list and not proceed to second page of attribute values list.

 

How to fix it? I tried on 2 servers, my development and on production with different PHP configurations no Javascript error is logged on console.

 

On my debug I found something in /controllers/admin/AdminAttributesGroupsController.php, in initProcess() method, for the first attribute values list access it has the query param 'viewattribute_group' and the code Tools::getIsset('viewattribute_group') pass correctly. But when I click second page on pagination links the initProcess is called twice, one with 'viewattribute_group' but after it reload the page without 'viewattribute_group'.

 

Thanks for help.

Link to comment
Share on other sites

Hi, i fixed this by adding a short code to 'AdminAttributesGroupsController.php' in /controllers/admin/

    public function setRedirectAfter($url)
    {
        $addUrl = '';
        if(Tools::isSubmit('viewattribute_group') && Tools::getValue('id_attribute_group')) {
            $addUrl = '&viewattribute_group&id_attribute_group=' . Tools::getValue('id_attribute_group');
        }

        $this->redirect_after = $url . $addUrl;
    }

dont know if its correct or buggy for other things but yet it works well

  • Like 2
Link to comment
Share on other sites

  • 1 month later...
  • 4 months later...
  • 2 months later...
  • 2 months later...

Btw same issue occurs in Features values list

 

Function fixex the bug too for Feature values.

We need to create an override for Admin Features Controller:

<?php

class AdminFeaturesController extends AdminFeaturesControllerCore
{

   public function setRedirectAfter($url)
    {
        $addUrl = '';
        if(Tools::isSubmit('viewfeature') && Tools::getValue('id_feature')) {
            $addUrl = '&viewfeature&id_feature=' . Tools::getValue('id_feature');
        }

        $this->redirect_after = $url . $addUrl;
    }
}
Link to comment
Share on other sites

  • 1 year later...

Hello vlester,

Just another question.
How to create an override of a TPL file under / admin / themes / default / template

For instance:
File _product_line.tpl
admin / themes / default / template / controllers / orders / _product_line.tpl

I want to make an override of this file

Link to comment
Share on other sites

On 7/3/2017 at 9:04 PM, vlester said:

 

Function fixex the bug too for Feature values.

We need to create an override for Admin Features Controller:


<?php

class AdminFeaturesController extends AdminFeaturesControllerCore
{

   public function setRedirectAfter($url)
    {
        $addUrl = '';
        if(Tools::isSubmit('viewfeature') && Tools::getValue('id_feature')) {
            $addUrl = '&viewfeature&id_feature=' . Tools::getValue('id_feature');
        }

        $this->redirect_after = $url . $addUrl;
    }
}

Can you tell me how you do that for Categories
I thought so, but that does not work

 

<?php

class AdminCategoriesController extends AdminCategoriesControllerCore
{

   public function setRedirectAfter($url)
    {
        $addUrl = '';
        if(Tools::isSubmit('viewCategory') && Tools::getValue('id_category')) {
            $addUrl = '&viewCategory&id_category=' . Tools::getValue('id_category');
        }

        $this->redirect_after = $url . $addUrl;
    }
}

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