ZF2 - Apigility not creating new api

1k Views Asked by At

I have Apigility running successfully on an app and have decided to use it for a new one. The problem I am stumped with is that it refuses to create a new api and appears to "hang" on the "create new api" screen.

Here is a screenshot of where it hangs: http://screencast.com/t/7CI3TN38Fm

Any advise on how to bug test this or has anyone experienced similar issues?

EDIT

When checking the console I note the following errors:

http://screencast.com/t/gIbZEWMwo

http://cloud.examplesite.dev/apigility/api/fs-permissions Failed to load resource: the server responded with a status of 403 (Forbidden)
vendor-angular.js:2 TypeError: Cannot read property 'fs_perms' of undefined
    at http://cloud.examplesite.dev/zf-apigility-admin/js/app.js:1:5838
    at j (http://cloud.examplesite.dev/zf-apigility-admin/js/vendor-angular.js:2:16336)
    at http://cloud.examplesite.dev/zf-apigility-admin/js/vendor-angular.js:2:17013
    at k.$eval (http://cloud.examplesite.dev/zf-apigility-admin/js/vendor-angular.js:2:21222)
    at k.$digest (http://cloud.examplesite.dev/zf-apigility-admin/js/vendor-angular.js:2:19926)
    at k.$apply (http://cloud.examplesite.dev/zf-apigility-admin/js/vendor-angular.js:2:21541)
    at f (http://cloud.examplesite.dev/zf-apigility-admin/js/vendor-angular.js:2:2732)
    at r (http://cloud.examplesite.dev/zf-apigility-admin/js/vendor-angular.js:2:4556)
    at XMLHttpRequest.w.onreadystatechange (http://cloud.examplesite.dev/zf-apigility-admin/js/vendor-angular.js:2:5095)vendor-angular.js:2 (anonymous function)
http://cloud.examplesite.dev/apigility/api/cache-enabled Failed to load resource: the server responded with a status of 403 (Forbidden)
3http://cloud.examplesite.dev/apigility/api/module Failed to load resource: the server responded with a status of 403 (Forbidden)
http://cloud.examplesite.dev/apigility/ui#/api Failed to load resource: net::ERR_CACHE_MISS
vendor-angular.js:2 GET http://cloud.examplesite.dev/apigility/api/dashboard 403 (Forbidden)
vendor-angular.js:2 GET http://cloud.examplesite.dev/apigility/api/dashboard 403 (Forbidden)

EDIT

After further investigation it would appear ZfcRbac is the cause of the problem... to create the Api it needs to be commented out.

Not sure of the best method to work around this... will investigate and post the answer once I know.

2

There are 2 best solutions below

0
On BEST ANSWER

What I did to resolve this was to create an autoload file: mydev.local.php and to include the following in it:

<?php
return [
    'zfc_rbac' => [
        'protection_policy' => \ZfcRbac\Guard\GuardInterface::POLICY_ALLOW
    ]

Problem solved. thanks!
];

This means that any route that is not in my guards is not protected... of course when going to live mode, the local override file is not included...

0
On

If you update Apigility to the dev-master this issue will go away.

In your composer.json use this

"require-dev":{
       "zfcampus/zf-apigility-admin": "dev-master"
}

and please disable opcache in php.ini also.