Skip to content
This repository has been archived by the owner on Jan 21, 2020. It is now read-only.

Unable to add field to REST API #379

Closed
twmobius opened this issue Nov 14, 2017 · 2 comments
Closed

Unable to add field to REST API #379

twmobius opened this issue Nov 14, 2017 · 2 comments

Comments

@twmobius
Copy link

twmobius commented Nov 14, 2017

So I've started with a ZF3 skeleton APP, and added Apigility as in the recipe (https://apigility.org/documentation/recipes/apigility-in-an-existing-zf2-application).

I've added via the composer zf-apigility 1.3.0 and zf-apigility-admin 1.5.10. I've added ApigilityProviderInterface in the Module.php and went to the admin-ui. I've added a new REST service in the module and tried to add a field. And there I'm getting errors on the console:

Duplicates in a repeater are not allowed. Use 'track by' expression to specify unique keys.

Looking into the network on the input-filter request I am getting multiple warnings and notices:

Warning: Illegal offset type in vendor/zfcampus/zf-configuration/src/ConfigResource.php on line 113
Notice: Undefined index: zf-content-validation in vendor/zfcampus/zf-apigility-admin/src/Model/InputFilterModel.php on line 141
Warning: Illegal offset type in vendor/zfcampus/zf-configuration/src/ConfigResource.php on line 113
Notice: Undefined index: input_filter_specs in /endor/zfcampus/zf-apigility-admin/src/Model/InputFilterModel.php on line 159

Eventually ending with a Internal Server Error with the message "Passed variable is not an array or object"

Searching through the generated module.config.php I can see that no 'input_filter_specs' => array() or 'zf-content-validation' => array() have been created. I tried adding the manually but I couldn't make it to work.

@michalbundyra
Copy link
Member

@twmobius Just guessing, but it seems for me that you are affected by #378
Please try set zfcampus/zf-configuration to <=1.3 in your composer and run composer update.
You can check before if you have installed version 1.3.1 of zf-configuration (composer show).

@twmobius
Copy link
Author

@webimpress You are right! I was using 1.3.1. Downgrading to 1.3.0 resolved the issue. Thank you very much!!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants