-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove ability to add a template part in the post editor #44397
Comments
I only got so far as to realize that
So the tests are failing and the filter will return I can't see much that might have changed in the meantime since #37157 🤔 cc @adamziel who might know straight away |
I think the filter stopped working after #42258 got merged. Testing
It might be a good idea to audit other blocks that are using side-effects - @gziolo, any ideas why the filters might stop working? |
@Mamaduka, I guess it means that the filter should get applied globally rather than only when the Template Part gets registered. It might be related to the order of execution, too. |
Unfortunately I don't :( @Mamaduka and @gziolo seem to be on the right track, though. It sounds like |
That might be the case for filter side effects. Would it be okay to add filters directly in the |
I think I identified what has changed: The filter from the block library got applied first, and then it would get overridden by the following version in post editor: gutenberg/packages/edit-post/src/index.js Lines 83 to 97 in 7829913
Now, the filter registered with the block goes after. The fix should be as simple as moving the code above after |
@gziolo, I'm not sure if that's the case. Even if I move the edit post filter after the |
Hmm, this appears to work for me, thanks everyone! I've thrown up a PR just in case it works for everyone else too 🤣 #44480 |
Description
Remove ability to add a template part in the post editor, including copy and pasting. This was previous in place #37157 but seems to now be allowed to add once more. I can replicate this with 6.1 beta 1.
Step-by-step reproduction instructions
Separately, notice that you can copy/paste a template part block from the template editor into a post editor, with or without Gutenberg installed, causing multi entity saving to appear in the post editor.
Screenshots, screen recording, code snippet
template.parts.mov
Environment info
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
The text was updated successfully, but these errors were encountered: