Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
AbstractRestfulController uses wrong action for id=0 #4175
Zend\Mvc\ControllerAbstractRestfulController::getIdentifier() has two instances of
These should both be
Otherwise the route /xxx?id=0 gets routed to the getList() action instead of the get() action
The unit test for this is probably this. I say probably, as can't run it; the ZF2 unit tests require phpunit-3.5 and I can't manage to downgrade my phpunit-3.6.10
This comment has been minimized.
This comment has been minimized.Show comment Hide comment
<< Why are you using an id of 0 >>
returns either a JSON list of widgets or an HTML list of widgets
returns either a JSON representation of widget 123, or an HTML page to edit widget 123.
returns an HTML page to create a new widget (not a list of widgets)
In any case, being a programmer, I might want to number my widgets from zero, rather than one ;-)
<< Also, BTW, ZF2 unit tests require PHPUnit 3.7, not 3.5 >>
My mistake. I got an error about 3.6.10 not being valid, and the first google result for the error message was a comment saying that ZF2 hoped to upgrade from 3.5 to 3.6 shortly. I guess I didn't check the date of the article (or look at the code...