ZF-11788: Wrong action in translated segment controller (use always the same action)

Description

Hi,

I create a "site/application" that automatically build navigation (for menu, ...) from database and i also created an .ini file with routes. I also use translation segment in controller name.


; Login - /fr/questions or /de/fragen
routes.faq_index.route = ":lang/:@controller"
routes.faq_index.defaults.module = default
routes.faq_index.defaults.controller = faq
routes.faq_index.defaults.action = index
routes.faq_index.reqs.lang = "^(fr|de)$"

; Product index - /fr/produits /de/produkte
routes.product_index.route = ":lang/:@controller"
routes.product_index.defaults.module = default
routes.product_index.defaults.controller = product
routes.product_index.defaults.action = supplierlist
routes.product_index.reqs.lang = "^(fr|de)$"

When i open url "/fr/produits" or "/de/produkte" all is fine, page show correct results, one in french and other page in german.

If now i go to "/fr/questions" or in german (is before in the routes.ini file)... i got that error (see below). If i inverse this 2 routes in the file, it works with "/fr/questions" but no more with "/fr/produits" (take index action and not supplierlist)


An error occurred
Page not found
Exception information:

Message: Action "supplierlist" does not exist and was not trapped in __call()
Stack trace:

#0 /var/www/cms.1234.local/bin/1234cms/library/Zend/Controller/Action.php(518): Zend_Controller_Action->__call('supplierlistAct...', Array)
#1 /var/www/cms.1234.local/bin/1234cms/library/Zend/Controller/Dispatcher/Standard.php(295): Zend_Controller_Action->dispatch('supplierlistAct...')
#2 /var/www/cms.1234.local/bin/1234cms/library/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#3 /var/www/cms.1234.local/bin/1234cms/library/Zend/Application/Bootstrap/Bootstrap.php(97): Zend_Controller_Front->dispatch()
#4 /var/www/cms.1234.local/bin/1234cms/library/Zend/Application.php(366): Zend_Application_Bootstrap_Bootstrap->run()
#5 /var/www/cms.1234.local/bin/1234cms/public/index.php(26): Zend_Application->run()
#6 {main}

array (
  'lang' => 'fr',
  'controller' => 'faq',
  'module' => 'default',
  'action' => 'supplierlist', // THIS IS WRONG, MUST TO BE "INDEX" IF I REFER TO THE ROUTES.INI FILE
)

In the navigation i added pages like that:


faq.label = faq_label
faq.route = faq_index

product.label = product_label
product.route = product_index

It open the right controller but the "action" still always "supplierlist" in that case (the last one in the routes.ini file) Why?

I also tried to create one route like that:


routes.custom.route = ":lang/:@controller"
routes.custom.reqs.lang = "^(fr|en)$"

and specify in the navigation.ini file, route (custom), controller, action.. but is the same result!

I don't know if is a bug but for me is not the an normal behavior. If i'm wrong, feel free to tell me, but this "problem" or "bug" block me in a big project..

Thanks in advance,

Comments

The creation of URLs is not in the remit of Zend_Navigation.