Skip to content

Site editor "post" mode prevents additional controls added to template parts from being saved #69900

@albanyacademy

Description

@albanyacademy

Description

We added some additional controls to the header and footer template parts through BlockEdit filters, and they work when editing the template, but not when you're in the "post" mode.

Step-by-step reproduction instructions

  1. Add additional controls to the template part block using the BlockEditor hook.
  2. Open the site editor, and attempt to use these controls when the post content is rendered / visible on the page.
    1. They should register as changed in the block editor store - if you check getSelectedBlock() in the inspector console, you'll see your attributes added to the returned block object. However, the "Save" button at the top does not become enabled. Even if you make some other change, like say rename the header block, your added controls are not saved to the end result.
  3. Now go into the site editor navigation and select a specific page template to edit and use those same controls.
    1. you should see that the controls behave normally - they enable the save button and after saving and reload, persist.

Screenshots, screen recording, code snippet

No response

Environment info

No response

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

  • Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

  • Yes

Please confirm which theme type you used for testing.

  • Block
  • Classic
  • Hybrid (e.g. classic with theme.json)
  • Not sure

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Feature] SavingRelated to saving functionality[Type] BugAn existing feature does not function as intended

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions