Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 1.9.0
-
Fix Version/s: 1.10.0
-
Component/s: Zend_Rest_Route
-
Labels:None
-
Tags:
Description
When extending Zend_Rest_Controller you are required to define the index, get, post, put, and delete actions.
Yet Zend_Rest_Route attempts to call the non-existent 'listAction' in the following block of code in match():
// Check for leading "special get" URI's $specialGetTarget = false; if ($pathElementCount && array_search($path[0], array('index', 'new')) > -1) { $specialGetTarget = array_shift($path); } elseif ($pathElementCount == 1) { $params['id'] = array_shift($path); } elseif ($pathElementCount == 0 || $pathElementCount > 1) { $specialGetTarget = 'list'; }
This results in the following exception and trace:
Exception information:
Message: Action "list" does not exist and was not trapped in __call()
Stack trace:
#0 /Users/hobodave/dev/php/blog/library/Zend/Controller/Action.php(515): Zend_Controller_Action->__call('listAction', Array)
#1 /Users/hobodave/dev/php/blog/library/Zend/Controller/Dispatcher/Standard.php(289): Zend_Controller_Action->dispatch('listAction')
The documentation doesn't mention any 'listAction', which leads me to believe the correct solution is to change 'list' to 'index'.
Attachments
Issue Links
| This issue is related to: | ||||
| ZF-7598 | Zend_Rest_Controller interface does not define listAction() |
|
|
|
Attached patch creating a new unit test to cover this, as well as the fix.