JuliusB Posted August 25, 2021 Share Posted August 25, 2021 (edited) Hi everyone, Using PS 1.6.1, I got an issu with some custom module and with hookModuleRoutes. Here is what I did : - I install one custom module with some custom URL rewritting it's working perfectly. - Then I try to install a second custom module with some URL rewritting, the first one URL rewriting is not working anymore but the second do work... I can't manage to make them both working at the same time 😕 Here is the code for the first module : public function install() { return parent::install() && $this->registerHook('moduleRoutes'); } public function hookModuleRoutes($params){ $my_link = array( 'module-csm-conf' => array( 'controller' => 'conf', 'rule' => 'c-m-s-{cview}-{product_id}', 'keywords' => array( 'cview' => array('regexp' => '[^/.]+', 'param' => 'cview'), 'product_id' => array('regexp' => '[0-9]+', 'param' => 'product_id'), ), 'params' => array( 'fc' => 'module', 'module' => 'cms', 'controller' => 'conf' ) ) ); return $my_link; } And the code for the second module : public function install() { return parent::install() && $this->registerHook('moduleRoutes'); } public function hookModuleRoutes($params){ $my_link = array( 'module-bdrc-bdr' => array( 'controller' => 'bdr', 'rule' => 'b-d-r-c-{cview}-{product_id}', 'keywords' => array( 'cview' => array('regexp' => '[^/.]+', 'param' => 'cview'), 'product_id' => array('regexp' => '[0-9]+', 'param' => 'product_id'), ), 'params' => array( 'fc' => 'module', 'module' => 'bdrc', 'controller' => 'bdr' ) ) ); return $my_link; } NB : I did try to change the rule but problem still remain the same.... Any idea anyone ? I searched on google and on this forum for hours with no success Thank you ! Edited August 25, 2021 by JuliusB (see edit history) Link to comment Share on other sites More sharing options...
SmartDataSoft Posted August 25, 2021 Share Posted August 25, 2021 Hello, Try to change the rule from the area. hope it will work. you can check our module https://github.com/smartdatasoft/smartblog/blob/develop/smartblog.php line after 1407 , your both module rule is conflict Thank you Link to comment Share on other sites More sharing options...
JuliusB Posted August 25, 2021 Author Share Posted August 25, 2021 Thank you for your answer ! Unfortunately I did try to change the rule and it still not working. I tried something like that : For the first module : 'rule' => cms/{product_id}', For the second module : 'rule' => 'bdrc-{product_id}', Without success 😕 I did try a lot of thing before posting on this forum... I took a look at your module and I don't figure out what I miss 😕 Link to comment Share on other sites More sharing options...
SmartDataSoft Posted August 25, 2021 Share Posted August 25, 2021 @JuliusB If you have no problem you can send me both module from PM (private message) i will analysis the code and will send you a solution within 1 days After change rule cleare the cache and try Thank you Link to comment Share on other sites More sharing options...
JuliusB Posted August 26, 2021 Author Share Posted August 26, 2021 (edited) @SmartDataSoft Thank you for your answer and your time ! Here I put the two modules with this message since it can help anyone having the same issue. I'm grateful thank you very much ! Thoses two module are reduce to the minimum so that you will not lose too much time debugging. confectionbrd.zip confections.zip Edited August 26, 2021 by JuliusB (see edit history) Link to comment Share on other sites More sharing options...
SmartDataSoft Posted August 26, 2021 Share Posted August 26, 2021 Hello, @JuliusB I have edit the module two line code. You can backup your own module and test my one. Both module url now working. Thank you confections.zip confectionbrd.zip Link to comment Share on other sites More sharing options...
JuliusB Posted August 26, 2021 Author Share Posted August 26, 2021 Hello, And thank you very much for your time and effort ! Unfortunately for me the problem remain the same : after installing the second module, URL rewriting of the first one doesn't work anymore. Which is a pretty bad news since it's working on your side. So it must be something else and finding out what it can be will be a real pain ! Link to comment Share on other sites More sharing options...
SmartDataSoft Posted August 26, 2021 Share Posted August 26, 2021 I have checked the issue on 1.6.1.24 and it works perfectly. Tell me which version you are working on. And please clear the cache properly before testing. It can happen because of the cache Link to comment Share on other sites More sharing options...
JuliusB Posted August 27, 2021 Author Share Posted August 27, 2021 I'm on PS 1.6.1.0 and yes I did clear the cache before testing. I did try to change the rule of the working module to see if changes are considered and yes they are. So there is something else 😕 I try to figure out what it can be 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