Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

V3 block default field values not saved on first save when only InnerBlocks are edited (autoInlineEditing: true) — regression since 6.6.2 fix

オープン
#1,013 コメント 1 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
55/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
php
領域
full-stack

調査の方向性

示されている block.json、my-block.php、およびレイアウトのデフォルト値を含むエクスポート済みのフィールドグループを使って問題を再現します。まず、InnerBlocks だけが変更された場合の初回保存時のブロック属性とシリアライズされたコンテンツを、Gutenberg の保存ボタンの状態も含めて比較します。各ブロックインスタンスで初回保存時にデフォルト値が保持され、保存後も保存ボタンが無効のままであれば完了です。

索引モデルが issue の本文から書いたものです。

説明

ACF V3 blocks with autoInlineEditing: true do not commit field default_value to block attrs on first save, unless the user explicitly interacts with an ACF field before saving. The ACF 6.6.2 changelog states this was fixed ("V3 Blocks now save default field values even if the block wasn't interacted with before saving"), but the fix does not apply when only InnerBlocks are edited.

Additionally, after saving a page containing such a block for the first time, the Gutenberg save button re-activates — suggesting ACF is modifying post_content server-side after the save, causing the editor to detect a content mismatch. When two or more instances of the same block are on the same page, only the last one has defaults correctly applied after the second save.

To Reproduce

Register a V3 ACF block with autoInlineEditing: true containing a select field with a default_value and an InnerBlocks area.
Insert the block on a page. The ACF field shows the default value in the editor sidebar (client-side only — expected).
Edit one of the block's InnerBlocks (e.g. type in the paragraph) or do not edit anything at all. Do not touch the ACF select field.
Click Save.
Reload the page in the editor.
Inspect the block — the ACF field is empty in the DB; default_value was not committed.

Expected behavior

The default_value for each field should be committed to block attrs on the first save, consistent with the fix described in the 6.6.2 changelog. The save button should remain disabled after saving with no server-side content mismatch.

Code
block.json:

{
  "name": "acf/my-block",
  "title": "My Block",
  "acf": {
    "blockVersion": 3,
    "autoInlineEditing": true,
    "usePostMeta": false,
    "renderTemplate": "my-block.php"
  },
  "apiVersion": 3
}

my-block.php:

<?php
$layout = get_field( 'layout' ) ?: 'left';
?>
<div class="my-block" data-layout="<?php echo esc_attr( $layout ); ?>">
    <InnerBlocks />
</div>

Field group JSON: (drag and drop the exported field group containing the layout select field with default_value: "left", allow_null: 0, assigned to acf/my-block)

Version Information:

WordPress Version: 7.0
PHP Version: 8.5.6
ACF Version: ACF PRO 6.8.1
Browser: Firefox 151.0.1

Additional context

Confirmed on a clean WordPress install with no plugins except ACF PRO 6.8.1. Custom theme hooks were ruled out by testing on a bare theme.
The save button re-activation suggests ACF's server-side processing modifies the serialized block comment after save, causing Gutenberg to detect a mismatch between what the editor sent and what the server returned.
The bug appears specific to autoInlineEditing: true — worth verifying whether the 6.6.2 fix only covers blocks without inline editing.

主要言語
PHP
スター
948
フォーク
198
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

AdvancedCustomFields/acf のほかの issue

AdvancedCustomFields/acf の issue をすべて見る

似ている issue

PHP の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。