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

Preview requiring multiple clicks to work #241

Open
1 of 3 tasks
felipesnts opened this issue Oct 10, 2024 · 0 comments
Open
1 of 3 tasks

Preview requiring multiple clicks to work #241

felipesnts opened this issue Oct 10, 2024 · 0 comments

Comments

@felipesnts
Copy link

Description

Preview is requesting multiple clicks on the WP "Preview Changes" button in order for GraphQL to return the correct preview values.

Steps to reproduce

  1. Clean WP install
  2. Installed: Advanced Custom Fields PRO 6.3.8, Classic Editor 1.6.5, WPGraphQL 1.28.1, WPGraphQL for ACF 2.4.1
  3. Added one test ACF field to post types "page" (JSON included below)
  4. Created 2 test pages

I get different behavior between the two pages.
On one of them preview works as expected.
On the other page, if I edit the AFC field content, click preview and then make a GraphQL request, it returns the published value, if I click on preview again, it returns the preview value. If I then make another edit and click preview, GraphQL returns the original published value again, so I have to click preview a second time to get the preview value to actually show in the GraphQL response.
I could not figure out why both pages behave differently since nothing different was done when I created both of them up.

PHP or JSON export of the ACF Field Group(s)

[
    {
        "key": "group_66fedede4ad3a",
        "title": "Page Content",
        "fields": [
            {
                "key": "field_66fedede25586",
                "label": "Subtitle",
                "name": "subtitle",
                "aria-label": "",
                "type": "text",
                "instructions": "",
                "required": 0,
                "conditional_logic": 0,
                "wrapper": {
                    "width": "",
                    "class": "",
                    "id": ""
                },
                "default_value": "",
                "translations": "translate",
                "maxlength": "",
                "placeholder": "",
                "prepend": "",
                "append": "",
                "show_in_graphql": 1,
                "graphql_description": "",
                "graphql_field_name": "subtitle",
                "graphql_non_null": 0
            }
        ],
        "location": [
            [
                {
                    "param": "post_type",
                    "operator": "==",
                    "value": "page"
                }
            ]
        ],
        "menu_order": 0,
        "position": "normal",
        "style": "default",
        "label_placement": "left",
        "instruction_placement": "label",
        "hide_on_screen": "",
        "active": true,
        "description": "",
        "show_in_rest": 0,
        "acfe_autosync": "",
        "acfe_form": 0,
        "acfe_display_title": "",
        "show_in_graphql": 1,
        "graphql_field_name": "pageContent",
        "map_graphql_types_from_location_rules": 0,
        "graphql_types": "",
        "acfe_meta": "",
        "acfe_note": ""
    }
]

Additional context

No response

WPGraphQL Version

1.28.1

WPGraphQL For ACF Version

2.4.1

ACF (Advanced Custom Fields) Version. Free or Pro?

6.3.8 Pro

WordPress Version

6.6.2

PHP Version

8.2.21

Additional enviornment details

No response

Please confirm that you have searched existing issues in the repo.

  • Yes

Please confirm that you have disabled ALL plugins except for WPGraphQL, WPGraphQL For ACF, ACF, etc.

  • Yes
  • My issue is with compatibility with a specific WordPress plugin, and I have listed all my installed plugins (and version info) above.
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

1 participant