0

I used Apigility to generate code-connected REST API wrappers for my ZF2 project - it all worked nicely (apart from a few file permissions issues which were easily resolved on the command line). Yesterday I ran a composer update and it updated Apigility to 1.0.4 and now my collection GET methods (with signatures fetchAll($params = array()) are getting called with an empty parameter array. I can see from Firebug console that these are still being called with the correct parameters browser side so it appears that something has changed with the Apigility wrapper processing that has broken this. Does anyone have any knowledge or can shed any light on why this might have changed / broken?

I also discovered that since the update I can't access the Apigility Admin UI that was used to generate the API wrappers, since it fails to load with a ZF2 routing error:

Fatal error: Uncaught exception 'Zend\Mvc\Router\Exception\RuntimeException' with message 'Part route may not terminate' in /private/var/www/vhosts/hamster.local/vendor/zendframework/zendframework/library/Zend/Mvc/Router/Http/Part.php:202 Stack trace: 
#0 /private/var/www/vhosts/hamster.local/vendor/zendframework/zendframework/library/Zend/Mvc/Router/Http/TreeRouteStack.php(351): Zend\Mvc\Router\Http\Part->assemble(Array, Array) 
#1 /private/var/www/vhosts/hamster.local/vendor/zendframework/zendframework/library/Zend/View/Helper/Url.php(100): Zend\Mvc\Router\Http\TreeRouteStack->assemble(Array, Array) 
#2 [internal function]: Zend\View\Helper\Url->__invoke('zf-apigility') 
#3 /private/var/www/vhosts/hamster.local/vendor/zendframework/zendframework/library/Zend/View/Renderer/PhpRenderer.php(399): call_user_func_array(Object(Zend\View\Helper\Url), Array) 
#4 /private/var/www/vhosts/hamster.local/vendor/zfcampus/zf-apigility-admin-ui/view/zf-apigility-ui.phtml(6): Zend\View\Renderer\PhpRenderer->__call('url', Array) 
#5 /private/v in /private/var/www/vhosts/hamster.local/vendor/zendframework/zendframework/library/Zend/Mvc/Router/Http/Part.php on line 202

Again I have no clue what might have caused this other than a borked update of Apigility. Regressing to v1.0.3 fixes both of these issues, but I'd like to have some of the updated features in 1.0.4.

Any help greatly appreciated!

urchino
  • 340
  • 3
  • 13
  • check if you haven't enabled the module twice, I had it in application.config and development.config and it caused this issue. – Mahakala Sep 04 '14 at 18:38
  • The missing params on the fetchAll methods is explained and resolved by a newly enforced requirement in zf-rest to whitelist method params for each endpoint in the module config. This is a simple resolution. The other issue is being looked at by the author of the zf-apigility-admin package but for the time being I'm sticking to the old revision. Thanks anyway for your help. – urchino Sep 11 '14 at 13:04

1 Answers1

0

In order to access to apigility admin, go to the file:

vendor/zfcampus/zf-apigility-admin-ui/view/zf-apigility-ui.phtml

and commet the line 6 and 14.

Maybe there are some problems with the routes.