Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom fields not updating via REST API #7327

Open
sc0ttkclark opened this issue Jul 17, 2024 · 15 comments · Fixed by #7339
Open

Custom fields not updating via REST API #7327

sc0ttkclark opened this issue Jul 17, 2024 · 15 comments · Fixed by #7339
Assignees
Milestone

Comments

@sc0ttkclark
Copy link
Member

Seems like it still doesn't work. Meta data fields i POST through the WP API remain empty. Whether i set "Allow All Fields To Be Updated" or allow one by one on field level. Should i raise a new issue for this?

Originally posted by @kilianso in #7318 (comment)

@sc0ttkclark sc0ttkclark self-assigned this Jul 17, 2024
@sc0ttkclark sc0ttkclark modified the milestones: Pods 3.2.5, Pods 3.2.6 Jul 17, 2024
@miguelomonroyb
Copy link

Hi there! Any workaround while 3.2.6 is out?

@sc0ttkclark
Copy link
Member Author

Trying to get this into Pods 3.2.6 for release tomorrow.

@sc0ttkclark
Copy link
Member Author

#7329

@sc0ttkclark
Copy link
Member Author

If anyone has time before tomorrow's release, I'd appreciate you trying Pods 3.2.6 out and letting me know if that resolves the write issues you're having.

release/3.2.6
https://github.com/pods-framework/pods/archive/refs/heads/release/3.2.6.zip

@sc0ttkclark
Copy link
Member Author

To help address the issue here, I added some automated testing coverage for it to help ensure long term stability.

@miguelomonroyb
Copy link

If anyone has time before tomorrow's release, I'd appreciate you trying Pods 3.2.6 out and letting me know if that resolves the write issues you're having.

release/3.2.6 https://github.com/pods-framework/pods/archive/refs/heads/release/3.2.6.zip

I just installed it, I let you know if It works or if anything else is required

@sc0ttkclark
Copy link
Member Author

@miguelomonroyb any luck?

@kilianso
Copy link

@sc0ttkclark I just quickly tested it on a stage environment using 3.2.6-a-1 and the issue persists for me. The data i POST looks something like this:

data: { status: 'draft', title: 'ABC' meta: { origin_url: 'abc.com' } }

I'm hitting the endpoint /wp-json/wp/v2/myCPTname

The field 'origin_url' remains empty. 'title' and other non-meta fields are submitted and saved correctly.

I tried each settings combination. "Allow All Fields To Be Updated" activated/deactivated and "Read/Write via REST API" activated/deactivated on field level.

@sclark3-godaddy
Copy link

Since you're using the meta level field saving, I'll look at this a bit further from that side.

@miguelomonroyb
Copy link

Same here, I'm using the meta level field saving and still the issue persists

@sclark3-godaddy
Copy link

To confirm, you have the "Register meta fields" option enabled in your Pods Admin > Settings, correct?

@miguelomonroyb
Copy link

I just enabled it, I will try it again

@sc0ttkclark
Copy link
Member Author

I'm releasing Pods 3.2.6 in the meantime, I can work more on this for Pods 3.2.7 but this release has to go out to address the bigger issue that impacted those using WP 6.5 and below.

@sc0ttkclark sc0ttkclark modified the milestones: Pods 3.2.6, Pods 3.2.7 Jul 22, 2024
@kilianso
Copy link

@sc0ttkclark I made a few tests and think I've narrowed down the issue. It seems related to the REST API settings here: Pods Admin > Edit Pods > CPTNAME > REST API.

  1. Submitting the metadata flat rather than inside a meta object resolves the issue, but only if the setting "Show as a custom object field (response.field_name)" is active, rather than "Include in the meta object (response.meta.field_name)". If the latter is chosen, neither submitting flat nor as a meta object will update the fields.
  2. The global setting "Allow All Fields To Be Updated" seems broken. Allowing read/write access on the field level, however, works.

I'm on WordPress 6.6 and Pods 3.2.6.

@JoryHogeveen
Copy link
Member

@kilianso Could you also verify #7339 and let me know if it works for you?

@sc0ttkclark sc0ttkclark modified the milestones: Pods 3.2.7, Next Release Aug 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants