funkhaus / fuxt-api

A WordPress plugin that extend the WP-JSON API to work with the fuxt framework.
1 stars 0 forks source link

if ACF is null the request errors out #71

Open dChiamp opened 6 days ago

dChiamp commented 6 days ago

Came across a weird issue today on See Me, where this specific URL causes a 500 error: https://see-me-api.flywheelsites.com/wp-json/fuxt/v1/post?uri=%2Fartists%2Fcameron-michael-debe%2F&fields=acf&fields=children&fields=terms

All other artists work fine.

The is wp-debug message:

api-err

It looks like an ACF error, so i thought maybe there was an empty field or something content related, but that's not the case.

Now i think it's an ACF issue with a child page, because if i remove the children term, it works. I resaved all child pages, cleared cache, and enabled dev mode but still having the issue.

Can you take a look?

rsm0128 commented 6 days ago

@dChiamp This PR should fix the issue. Please let me know if it doesn't work. Thanks!

dChiamp commented 6 days ago

@rsm0128 interestingly it looks like that worked for 2 of 3 of the pages with issues, but this one is still having issues: https://see-me-api.flywheelsites.com/wp-json/fuxt/v1/post?uri=/artists/cameron-michael-debe/new-museum-discover-demo/&fields=acf

I drafted that page for now so i can make and deploy updates. Do you have access to this site?

rsm0128 commented 5 days ago

@dChiamp There was another edge case for validation and I fixed it. Please check and let me know if you face any other issues.

dChiamp commented 5 days ago

OK looks like that fixed it! thanks @rsm0128