Skip to content
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

Fix availableBlocks override eachother #2503

Open
wants to merge 2 commits into
base: 3.x
Choose a base branch
from

Conversation

Tofandel
Copy link
Contributor

Fixes #2502

Simple fix is to add a unique id when rendering the component to find the correct availability key

Also included a bit of future proofing and backward compatibility even if the partial is overidden

@@ -265,7 +267,7 @@
}
},
checkIfBlockTypeIsAvailable (editorName, type) {
const availableBlocks = JSON.parse(JSON.stringify(this.availableBlocks(editorName)))
const availableBlocks = this.availableBlocks(editorName)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to deepclone this in this function, it's only being searched

@@ -179,9 +182,8 @@
}),
...mapGetters([
'blocks',
'fieldsByBlockId',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not used in the component

@Tofandel Tofandel force-pushed the fix-availability-override branch 2 times, most recently from 41a8103 to d36a511 Compare February 27, 2024 20:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Editors with the same name override eachother's availableBlocks
1 participant