You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Site Editor - editing a specific Post dirties the home page instead. #23967
I'm currently not able to replicate this... One difference in my setup is that when I switch to a post, it shows the "singular" template rather than the "index" template. I wonder if it could be related
Sounds like it could, since index is the catch-all fallback for all template types. Maybe try with 2020 Blocks (since I think that's what Addie is using, judging from her gif)?
I was able to replicate this by using the index template with a static homepage. Then, when I switched to an individual post, an edit to post content actually updated the homepage.
I also wanted to note that you don't have to edit the homepage first - you can just load the editor, navigate directly to an individual post, and then editing it will dirty the homepage.
Activity
noahtallen commentedon Jul 15, 2020
I'm currently not able to replicate this... One difference in my setup is that when I switch to a post, it shows the "singular" template rather than the "index" template. I wonder if it could be related
ockham commentedon Jul 15, 2020
Sounds like it could, since index is the catch-all fallback for all template types. Maybe try with 2020 Blocks (since I think that's what Addie is using, judging from her gif)?
noahtallen commentedon Jul 16, 2020
I was able to replicate this by using the index template with a static homepage. Then, when I switched to an individual post, an edit to post content actually updated the homepage.
noahtallen commentedon Jul 17, 2020
I also wanted to note that you don't have to edit the homepage first - you can just load the editor, navigate directly to an individual post, and then editing it will dirty the homepage.
noahtallen commentedon Jul 17, 2020
Mid-way down the stack, the issue is coming from here:
gutenberg/packages/block-library/src/post-content/inner-blocks.js
Lines 8 to 12 in 79271eb
I believe that
onChangeis not updating whenpostTypechanges (even thoughblocksdoes).If we add a
key(to force react to destroy and remount the component when the key changes) to this line, then it works correctly.gutenberg/packages/block-library/src/post-content/edit.js
Line 14 in 79271eb
I'm looking into
useEntityBlockEditorto see which hook or component isn't updating correctly whenpostTypechanges.noahtallen commentedon Jul 17, 2020
I am mistaken about this.
onChangeis updating whenpostTypechanges, so I think that the inner block controller is not handling this correctly.noahtallen commentedon Jul 17, 2020
My new hunch is that the
onChangecallback has not been updated here:gutenberg/packages/block-editor/src/components/provider/use-block-sync.js
Lines 172 to 178 in 79271eb
noahtallen commentedon Jul 17, 2020
Yep, that was it. PR should fix that scenario and I added a test to make sure it doesn't break in the future