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

Need to handle infinite loops #2

Open
jmikrut opened this issue Aug 29, 2018 · 3 comments
Open

Need to handle infinite loops #2

jmikrut opened this issue Aug 29, 2018 · 3 comments

Comments

@jmikrut
Copy link

jmikrut commented Aug 29, 2018

Hi, thanks for this plugin - it's simple and super helpful.

One thing I noticed is that if an admin on a WP site using this plugin accidentally adds an ACF Relationship field to the same post that they are working with, the REST API response breaks and runs into an infinite loop situation.

Should be a similar fix I'd imagine to make sure that this is avoided. If I have time I will try to crack in and make a pull request. In the meantime I thought I'd let you know!

@andrew-boyd
Copy link

@jmikrut Our team ran into the same issue. Our attempt to address it can be seen in PR #3

@adamk22
Copy link

adamk22 commented Jan 10, 2019

I ran into an issue where my rest api would give a SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data wp rest response.

The page gave the following error:

<br />
<b>Fatal error</b>:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes) in <b>/srv/www/test-wp/public_html/wp-content/plugins/acf-to-rest-api-recursive-master/library/class-acf-to-rest-api-recursive.php</b> on line <b>56</b><br />
<br />
<b>Fatal error</b>:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes) in <b>/srv/www/test-wp/public_html/wp-includes/wp-db.php</b> on line <b>1889</b><br />

The fix @andrew-boyd supplied in his Pull Request solved this issue.

@Kohrak
Copy link

Kohrak commented Jan 26, 2019

Hi, thanks for this plugin - it's simple and super helpful.

One thing I noticed is that if an admin on a WP site using this plugin accidentally adds an ACF Relationship field to the same post that they are working with, the REST API response breaks and runs into an infinite loop situation.

Should be a similar fix I'd imagine to make sure that this is avoided. If I have time I will try to crack in and make a pull request. In the meantime I thought I'd let you know!

Can I ask you how did you manage to set it up? @jmikrut

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

No branches or pull requests

4 participants