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: shadow blocks with variable fields are allowed to be deserialized from XML #7802

Merged
merged 1 commit into from Jan 23, 2024

Conversation

ebrahim95
Copy link
Contributor

@ebrahim95 ebrahim95 commented Jan 23, 2024

The basics

The details

Resolves

Enabling the ability for shadow blocks to be de-serialized from XML.

Fixes #7779

Proposed Changes

The PR deletes

    // Ensure this block doesn't have any variable inputs.
    if (block.getVarModels().length) {
      throw TypeError('Shadow blocks cannot have variable references.');
    }

in the core/xml.ts file.

Reason for Changes

There is no reason to disallow serialization and also the JSON serialization system does not have this constraint.

Test Coverage

I tested the results by trying to reproduce the error.
The error was fixed as it did not appear in the console.

Documentation

Additional Information

@ebrahim95 ebrahim95 requested a review from a team as a code owner January 23, 2024 03:37
@github-actions github-actions bot added PR: fix Fixes a bug and removed PR: fix Fixes a bug labels Jan 23, 2024
@BeksOmega
Copy link
Collaborator

This looks great! Thank you for the fix @ebrahim95 =)

@BeksOmega BeksOmega merged commit ff45a36 into google:develop Jan 23, 2024
12 checks passed
@ebrahim95 ebrahim95 deleted the dev_7779 branch February 13, 2024 00:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: fix Fixes a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow shadow blocks with variable fields to be deserialized from XML
2 participants