Jump to content

Custom Module Route conflict


JuliusB

Recommended Posts

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 by JuliusB (see edit history)
Link to comment
Share on other sites

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

@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 by JuliusB (see edit history)
Link to comment
Share on other sites

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

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

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