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: preserve toolbox category IDs #53

Closed
wants to merge 1 commit into from
Closed

Conversation

gonfunko
Copy link
Owner

This PR copies the toolbox category ID to the correct key for modern Blockly. This is required for gonfunko/scratch-gui#8 to work end-to-end.

@BeksOmega
Copy link
Collaborator

Where is toolboxitemid referenced? I did a search in GUI and couldn't find it.

@gonfunko
Copy link
Owner Author

It's used when assigning the ID to the ToolboxItem in core: https://github.com/google/blockly/blob/185c82a991484e68b1a76825f2c4b082b0168677/core/toolbox/toolbox_item.ts#L46

Without this, core synthesizes an ID for the toolbox category, which doesn't match the ID Scratch knows about causing getToolboxItemById() to return null. Core apparently used to look for id a few years back but changed the key it uses.

Copy link
Collaborator

@BeksOmega BeksOmega left a comment

Choose a reason for hiding this comment

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

Well that's annoying. But I can see why they didn't want the id attribute in XML to conflict with DOM IDs :P

Do we have access to the actual defs? and if so can we migrate them instead?

Assuming not, so approving based on that assumption.

@gonfunko
Copy link
Owner Author

Oh good call, yes. Reverting this PR in favor of gonfunko/scratch-vm#2
and gonfunko/scratch-gui#9.

@gonfunko gonfunko closed this Apr 30, 2024
@gonfunko gonfunko deleted the extensions branch April 30, 2024 22:35
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.

2 participants