Glauber Posted September 8, 2016 Share Posted September 8, 2016 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 More sharing options...
daveyrow Posted September 13, 2016 Share Posted September 13, 2016 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 2 Link to comment Share on other sites More sharing options...
daveyrow Posted September 13, 2016 Share Posted September 13, 2016 Btw same issue occurs in Features values list Link to comment Share on other sites More sharing options...
Glauber Posted October 17, 2016 Author Share Posted October 17, 2016 Yes the override on setRedirectAfter($url) for the specific controller really works. Thanks!! Link to comment Share on other sites More sharing options...
Eolia Posted February 27, 2017 Share Posted February 27, 2017 Fine Thanks !! Link to comment Share on other sites More sharing options...
kimwebfan Posted April 30, 2017 Share Posted April 30, 2017 Thanks for the fix! Link to comment Share on other sites More sharing options...
vlester Posted July 3, 2017 Share Posted July 3, 2017 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 More sharing options...
Eolia Posted July 3, 2017 Share Posted July 3, 2017 commit for 1.6.1.16... Link to comment Share on other sites More sharing options...
Hans Wolf Posted March 2, 2019 Share Posted March 2, 2019 Hello vlester, This override also works well for 1.7.5.1 (see attachment) Or should something be added? AdminFeaturesController.php Link to comment Share on other sites More sharing options...
vlester Posted March 2, 2019 Share Posted March 2, 2019 Sorry, I can't tell you, haven't tried it on Prestashop 1.7. Link to comment Share on other sites More sharing options...
Hans Wolf Posted March 2, 2019 Share Posted March 2, 2019 (edited) Hello vlester, Yes it works well, but maybe something needs to be added? Edited March 2, 2019 by Hans Wolf (see edit history) Link to comment Share on other sites More sharing options...
Hans Wolf Posted March 2, 2019 Share Posted March 2, 2019 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 More sharing options...
vlester Posted March 2, 2019 Share Posted March 2, 2019 You would have to put your file in /override/controllers/admin/templates/orders/_product_line.tpl Link to comment Share on other sites More sharing options...
Hans Wolf Posted March 2, 2019 Share Posted March 2, 2019 But it does not work under PS1.7 :< If I apply it under PS1.6, it just works Link to comment Share on other sites More sharing options...
Hans Wolf Posted March 7, 2019 Share Posted March 7, 2019 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 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