wp-graphql-acf icon indicating copy to clipboard operation
wp-graphql-acf copied to clipboard

Getting JS "leave page" warning

Open drewbaker opened this issue 3 years ago • 6 comments

With v0.5.1 anytime I open a field group to edit it, and then do nothing, and try to leave the page, I get this error:

Screen Shot 2021-04-26 at 4 41 35 PM

drewbaker avatar Apr 26 '21 14:04 drewbaker

@drewbaker hmm. I don't know if this is related to anything this plugin has done. If you de-activate WPGraphQL for ACF does this behavior go away?

jasonbahl avatar Apr 28 '21 20:04 jasonbahl

@jasonbahl Yeah this is my test setup:

  • Theme: TwentySeventeen (current version, although also tested with our fuxt-backend theme)
  • Plugins: Advanced Custom Fields PRO, WP GraphQL, WPGraphQL for Advanced Custom Fields (all updated to current versions)

And if I just browse to the custom fields list, enter into a field group, do nothing, click on any link in the sidebar (like plugins or pages) I'll get that pop up.

If I disable WPGraphQL for Advanced Custom Fields, then I don't get that confirm popup.

Tested in Firefox and Chrome.

drewbaker avatar Apr 29 '21 13:04 drewbaker

@drewbaker very interesting. I'll look into this. I'm curious what's causing this. Possibly the JS that I have that hooks into the ACF Field Group "model" class or something. 🤔

Will look into it.

jasonbahl avatar Apr 30 '21 16:04 jasonbahl

Just updated to v0.5.2 from v0.4.1 and started to experience this issue, no other updates to my environment were made

justin-bond avatar May 14 '21 01:05 justin-bond

Just installed 0.5.3 on Wordpress 5.9.2 and I'm getting the same thing.

Steps

  1. Click on Custom Fields from WP Menu
  2. Click to edit any Field Group
  3. Do nothing
  4. Click away to Pages from the WP menu
image

james0r avatar Mar 13 '22 09:03 james0r

I started getting the same bug on my sites. To narrow it down I created a fresh install of WordPress using the default Twenty Twenty Two theme.

I installed only these plugins:

Advanced Custom Fields PRO 5.12 WP Gatsby 2.3.2 WP GraphQL 1.7.2 WPGraphQL for Advanced Custom Fields 0.5.2

I activated all the plugins.

I then created two ACF field groups.

In group 1, I created a simple text field, and saved it. Leaving the page DID NOT trigger a 'Leave Site? Changes you made may not be saved' alert message. In group 2, I created a simple text field, activated 'Show in GraphQL', and saved it. Leaving the page DID trigger the 'Leave Site? ...' alert message.

  • Activating WPGraphQL for Advanced Custom Fields didn't of itself cause the bug - it only happened when I activated 'Show in GraphQL' for a field group.
  • Leaving the page after dismissing the alert (i.e. clicking 'Leave') did not result in changes being lost - the field group was successfully saved, so, from my point of view, it's not major, just disconcerting.

chrisnajman avatar Mar 22 '22 06:03 chrisnajman