Usage of lockPostSaving() to lock the post editor prevents dismissing the ACF Blocks V3 expanded editor modal
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 48/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- javascript, php
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.
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
- Dominant language
- PHP
- Stars
- 947
- Forks
- 198
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
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.
More from AdvancedCustomFields/acf
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
AdvancedCustomFields/acf#1056 ·
-
PHP 8.5: "Using null as an array offset" deprecation in ACF_Data::is() when rendering a block with empty data (local-meta.php is_request)Possibly taken @faisalahammad claimed this 30 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
AdvancedCustomFields/acf#1044 ·
-
is_preview was called incorrectly notice on every early get_field() since 6.8.10 (acf_revisions::acf_validate_post_id)Possibly taken @faisalahammad claimed this 30 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
AdvancedCustomFields/acf#1041 · 1 comment ·
-
True / False ACF control bug on RTL layoutsPossibly taken @elicohenator claimed this 53 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
AdvancedCustomFields/acf#1038 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
AdvancedCustomFields/acf#1034 · 3 comments ·
All issues in AdvancedCustomFields/acf
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 3 days
-
sync-en
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day
-
[Sync EN] Formatting improvements to "Large Objects (LOBs)" docs (#6056)Possibly taken A pull request linked to this issue is open or already merged. Opensync-en
Difficulty 1/5 Under an hour Newbie friendliness 74/100
Maintainers usually reply within 1 day
-
Перевод устарел
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
Maintainers usually reply within 1 day
-
repo:cms
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
craftcms/cms#20613 · 1 comment ·
Maintainers usually reply within 1 day