AdvancedCustomFields / AdvancedCustomFields/acf
Usage of lockPostSaving() to lock the post editor prevents dismissing the ACF Blocks V3 expanded editor modal
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 945
- Forks
- 197
- PR merge metrics
- No merged PRs in 30d
Description
Describe the bug
In our custom block work, we lock post saving when certain required fields are empty using lockPostSaving() like so:
dispatch('core/editor').lockPostSaving('our-theme-custom-lock-id');
This causes the ACF block V3 expanded modal to lock, preventing dismissal.
To Reproduce
Steps to reproduce the behavior:
- Add editor JS to lock the post editor using a custom lock, or try this in the browser console with the WP editor open:
window.wp.data.dispatch('core/editor').lockPostSaving('my-example-lock-id');. This should lock post saving/publishing. - Select an ACF block and click the "Open Expanded Editor" button to expand the ACF block form modal.
- Attempt to click the modal dismiss button labeled "done" or otherwise attempt to dismiss and close the modal to return to the editor.
Expected behavior
We would expect that locking post saving does not lock the ACF expanded edit modal, and that this modal is dismissible even if post saving is locked. This issue prevents users from closing the modal and addressing anything else in the editor.
Screenshots or Video
Code
Relevant example block.json below. I found that no fields need to be registered to the block. The modal cannot be dismissed regardless of the block's registered fields.
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 3,
"title": "Example Block",
"textdomain": "my-custom-domain",
"name": "myplugin/myblockname",
"icon": "feedback",
"category": "text",
"acf": {
"blockVersion": 3,
"renderTemplate": "template.php"
},
"style": "file:./style.min.css"
}
Version Information:
- WP version 6.9.4
- PHP version 8.4
- ACF Pro 6.7.1
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue with the documented lockPostSaving() dispatch and an ACF Blocks V3 expanded editor modal. Start by tracing the ACF Blocks V3 modal integration and its handling of the WordPress editor lock; done means the modal can be dismissed while post saving remains locked.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, php
- Domain
- frontend, web-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100