thebatclaudio / wp-rest-api-v2-menus

Adding menus endpoints on WP REST API v2
47 stars 23 forks source link

Bug: ERR_EMPTY_RESPONSE when calling get_fields on a menu #27

Closed nilsabdi closed 4 years ago

nilsabdi commented 4 years ago

I'm using various ACF fields in my menus which my site depends on upon loading. In this implementation I use the locations aspect of the plugin very heavily and recently I've started being met with ERR_EMPTY_RESPONSE when any ACF fields are associated with a menu.

So, I've found the offending line to be the following: https://github.com/thebatclaudio/wp-rest-api-v2-menus/blob/ead7a88734fbbf9689759e052c9a3764841fdeaf/wp-rest-api-v2-menus.php#L76

I've updated ACF (and ACF Pro) to no avail. I'm currently running PHP 7.3.9 (and also experience this with PHP 7.0.33)

I cannot find errors in any of the relevant log files.

Any ideas on what this could be causing this issue?

nilsabdi commented 4 years ago

This is also the case when calling the individual menu /menus/v1/menus/{menu-slug / menu ID} or when simply listing all menus.

nilsabdi commented 4 years ago

Hmm, it starts working again when I disable WooCommerce.

nilsabdi commented 4 years ago

I've been working on trying to reproduce the bug -- without any luck. I've tested on a clean WP install with all the same plugins, WP network enabled and it all works as expected.

I imported the current buggy version of the site with All-in-One WP Migration and I currently expect that something must have been imported wrong.

So, just to clarify this does not seem like a general bug -- it has to be something specific to my site setup.

nilsabdi commented 4 years ago

I think it's safe to say the bug lies with ACF (and not this wonderful plugin).

The site works as expected when I disable the default application of formatting in regards to calling get_fields. This makes me believe that my ACF data somehow breaks the site when formatting is applied, I've now opened a bug report with the developers of ACF.