airesvsg / acf-to-rest-api

Exposes Advanced Custom Fields Endpoints in the WordPress REST API
https://wordpress.org/plugins/acf-to-rest-api/
1.32k stars 111 forks source link

Can only update one repeater field at a once??? #250

Open NickGrant89 opened 6 years ago

NickGrant89 commented 6 years ago

Hi,

Im having a load of trouble with 2 repater fields.

I added my first RF and added the filter to my functions.php file. Then tested the fields through Postman and it worked as expected, fields updated.

Then i added another RF to the same group and added the filter to my functions.php file. then tested the api call in Postman and it updated as expected.

Then i went back to the first repeater field and tried the call again and im now getting a {\"code\":\"cant_update_item\",\"message\":\"Cannot update item\",\"data\":{\"status\":500}}

but the second RF is still working. Please can someone help iv been going round in circles for days.

Thanks

Nick

acf functions.zip

NickGrant89 commented 6 years ago

@airesvsg

Please can you help with this issue.

Best wishes

Nick

airesvsg commented 6 years ago

Hi @digital1989,

Please, check those links below. http://airesgoncalves.com.br/acf-to-rest-api/ ( tab repeater ) https://github.com/airesvsg/acf-to-rest-api-example

Thanks

NickGrant89 commented 6 years ago

Hi @airesvsg

Thank you for your reply.

I have read through evey bit of documentation and its still not working. I have 2 repeater fields, on 1 site, with the filters in functions.php to make the repeater fields editable by REST. The problem im having is only one filter seems to work at a time. I have recreated this problem on a blank wordpress just using the plugins required and a basic theme and im still getting the same issue. I cant for the life of me figure out whats going wrong.

I also have another site with 5 repeater fields and REST works fine. No issues. I then took that theme with the setting that worked and im getting the same issue as the problem above. I hope iv explained well enogh, if you require any more info ill get it sent over asap.

Wordpress - Version 4.9.6 ACF Pro - Version 5.6.10 - V3 not V2 ACF to REST - Version 3.1.0 JSON Basic Authentication - Version 0.1 WP REST API - Version 2.0-beta15

Many thanks

Nick

NickGrant89 commented 6 years ago

Hi @airesvsg

I dont mean to bug you but im really lost to what this issue could be.

I could really do wityh your help.

Thnaks

airesvsg commented 6 years ago

Can you send me your files and database dump?

My email is: airesvsg@gmail.com

Thanks

NickGrant89 commented 6 years ago

@airesvsg

I have sent it all over.

Thank you for your time and help

NickGrant89 commented 6 years ago

Hey @airesvsg

ANy luck?

Best wishes

Nick

airesvsg commented 6 years ago

Hi @digital1989 , Follow the steps below:

  1. Remove the filter "acf/rest_api/key" in your functions.php
  2. Update your fields ( Custom Fields > Tools > Import Field Groups > acf-export-2018-06-21.json ). You forgot the sub-field name on field group me.
  3. Copy the content of the file repeater.json and paste on Postman - Change Text to JSON (application/json) on Body tab ( Screenshot from 2018-06-21 10-48-03.png ).

Files: acf-to-rest-api-issue-250.zip

Thanks