ZF-7656: Creating a rest controller automatically makes the default index controller also rest-based.
Description
if I define a rest controller from a module to be a rest route, the index controller from the module also becomes a rest controller:
Example:
$front->getRouter()->addRoute('guides::rules', new Zend_Rest_Route($front, array(),array('guides'=>array('rules'))));
This would cause the "guides" module's "index" controller to become a rest controller, unless I later override it with:
$front->getRouter()->addRoute('guides', new Zend_Controller_Router_Route('guides/', array( 'module' => 'guides', 'controller' => 'index', 'action' => 'index' )));
which is basically a patch on the wound.
Comments
Posted by Luke Crouch (lcrouch) on 2009-08-25T13:59:25.000+0000
Can you tell me the exact HTTP request that gave this behavior?
e.g., GET /guides/index/index ?
Thanks, -L
Posted by Onno Lissenberg (orlissenberg) on 2009-09-01T00:36:08.000+0000
Seems to be resolved in the current version!
Thanks
Posted by Tim Brayshaw (twisty) on 2009-11-27T04:42:34.000+0000
I don't think this is resolved. Here are two tests for Zend_Rest_RouteTest (excuse the hideous method names!) to confirm...
The first test passes, the second fails.
1) Zend_Rest_RouteTest::test_postToNonRESTfulDefaultController_moduleHasAnotherRESTfulController_noDefaultControllerInURL_returnsFalse Failed asserting that Array ( [module] => mod [action] => post [controller] => index )Cheers, Tim.
Posted by Luke Crouch (lcrouch) on 2009-12-21T17:09:44.000+0000
I added the missing controller check in the case of default, non-URI controllers. Good catch! Thanks for posting the exact test methods too - that made it much easier to fix.