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

ACF required fields cause a saving stall out with no notices #9699

Closed
treysea opened this issue Sep 7, 2018 · 6 comments
Closed

ACF required fields cause a saving stall out with no notices #9699

treysea opened this issue Sep 7, 2018 · 6 comments
Labels
[Status] Needs More Info Follow-up required in order to be actionable. [Type] Plugin Interoperability Incompatibilities between a specific plugin and the block editor. Close with workaround notes.

Comments

@treysea
Copy link

treysea commented Sep 7, 2018

Hello! I was able to resolve this issue by making my required fields not required, but it took some time to troubleshoot that. So putting this here to help someone else who is having the same problem.

Scenario:
WP Site running Gutenberg [3.7.0] and ACF Pro [4.3.7]
Installed in a subdirectory
The issue occurred on a custom post type, but I don't think that's relevant to the problem

Open an existing post, make an edit to any field, click 'update'. The update button goes into an infinite loop and looks like it is trying to save. But the 'post updated! view post' flag appears below, so it is unclear whether it worked or not. Check the front end or reload the backend and see that it did not update.

screenshot_2018-097_3694

Turned out that there were custom fields set to "Required" that did not have data on the post in question because the requirement was added after the empty field had already been saved. So turning off the requirement resolved the issue.

This is unexpected behavior, there was no error notice near the required fields or other clues about what was wrong. It would be helpful to return an error message on the front end prompting the user to fill out the required fields.

These js errors were in the console:
error_messages

@designsimply designsimply added [Type] Plugin Interoperability Incompatibilities between a specific plugin and the block editor. Close with workaround notes. Needs Testing Needs further testing to be confirmed. labels Sep 7, 2018
@designsimply
Copy link
Member

Thank you for commenting and for including a screenshot! In the screenshot of the console errors you posted, the query string contains &classic-editor=1. Are you using the classic editor or Gutenberg? May I ask if you temporarily disable Gutenberg whether the same problem happens?

Here is a copy of the console errors from your screenshot for reference:

POST http://{unknowndomain}/wp-admin/post.php?post=196&action=edit&classic-editor=1&meta_box=1 500 (Internal Server Error)
VM3350:1

Uncaught (in promise)
Response {type: "basic", url: "http://{unknowndomain}/wp-admi..?post=196&action=edit&classic-editor=1&meta_box=1, redirected: false, status: 500, ok: false, …}
. post.php?poste=196&action=edit:1

Your post mentioned ACF Pro 4.3.7, but is that your WordPress version? If yes, could you verify you have updated to the latest stable release of ACF Pro? (5.7.4 at the time of this writing)
https://www.advancedcustomfields.com/changelog/

May I ask if you have also reported this problem at https://www.advancedcustomfields.com/support/ already? I tried searching and I did notice a similar-sounding problem was reported in that forum for ACF Pro 5.7.1 at https://support.advancedcustomfields.com/forums/topic/major-cant-publish-anything-ver-5-7-0-beta2/ that has one reply that says "Cant Publish/Update. Endless turning Arrow in WP Update Button" but I also saw that another person on that thread noted a console error that was different compared to the one you posted (which I am not sure yet is relevant or not).

@ramiroazar
Copy link

Also experiencing this issue. Can verify that this happens using Gutenberg, despite the &classic-editor=1 parameter in the query string. Required fields function as expected using the classic editor, preventing submission and outputting validation alerts if empty, but saving successfully without errors once populated.

Advanced Custom Fields PRO 5.7.5
Gutenberg 3.7.0

Uncaught (in promise) Response {type: "basic", url: "http://lung-foundation-new-multisite.local/wp-admi…?post=266&action=edit&classic-editor=1&meta_box=1", redirected: false, status: 500, ok: false, …}

@designsimply
Copy link
Member

Thank you for the extra info! @ramiroazar, to confirm, does the problem happen only when both ACF Pro and Gutenberg are installed? Or does the problem also happen if either one or the other of those is installed and activated separately? The goal for that question is to try to verify whether the problem is a result of a conflict with these two plugins as opposed to something else.

I searched online to learn more about 500 errors and several of the articles (like this one) recommend checking the server error logs at the time the error occurs to get more information which may help pinpoint the problem. Is that something you are able to do? A 500 error indicates the server wasn't able to process a request of some kind, but it doesn't help show what may be causing the trouble. Seeing related server error logs may help narrow down the source of the conflict in this case.

@ramiroazar
Copy link

This error happens when publishing or updating a post using Gutenberg which contains empty required fields registered using Advanced Custom Fields PRO. Therefore, it does not manifest unless both plugins are installed and activated.

Having checked the local server error logs, it seems nothing is getting logged relating to or resulting from this error.

It may also be worth noting that I'm unable to replicate #9983.

@designsimply
Copy link
Member

I've tested again using the following steps and am able to see the "Saving" indicator in an infinite loop when I try to update a post which has an empty required custom field made with the Advanced Custom Fields plugin.

  1. Install & activate Gutenberg 4.5.1.
  2. Install & activate Advanced Custom Fields 5.7.7.
  3. Go to Custom Fields > Add New and add at least one required field.
  4. Go to Posts > Add New.
  5. Add a title and some content.
  6. Do not add anything to the required custom field.
  7. Try saving and publishing the post and check that the

Result: the post content does update for me though I can see the "Saving" indicator pulse indefinitely (the "Update" button looked fine in my test) and I see the following 500 error in the Network panel in devtools:

screen shot 2018-11-28 at 3 25 23 pm

Note: I used the free version of ACF and not the Pro version for testing.

@designsimply designsimply removed Needs Testing Needs further testing to be confirmed. [Status] Needs More Info Follow-up required in order to be actionable. labels Nov 28, 2018
@youknowriad
Copy link
Contributor

Is this still an issue? I know both ACF and Gutenberg have been updated to fix conflicts.

@youknowriad youknowriad added the [Status] Needs More Info Follow-up required in order to be actionable. label Dec 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Status] Needs More Info Follow-up required in order to be actionable. [Type] Plugin Interoperability Incompatibilities between a specific plugin and the block editor. Close with workaround notes.
Projects
None yet
Development

No branches or pull requests

4 participants