Skip to content

fix: Fix bug when pasting mutatorarg blocks#9866

Open
LappiLappland wants to merge 1 commit into
RaspberryPiFoundation:mainfrom
LappiLappland:fix/mutatorarg-paste
Open

fix: Fix bug when pasting mutatorarg blocks#9866
LappiLappland wants to merge 1 commit into
RaspberryPiFoundation:mainfrom
LappiLappland:fix/mutatorarg-paste

Conversation

@LappiLappland
Copy link
Copy Markdown

The basics

The details

Resolves

Fixes #9865

Proposed Changes

Updated procedures_mutatorarg block's validator_ function, so that it generates unique name if current name is invalid, when user is pasting block

this.editingInteractively check for duplicates ensures that:

  • if user is editing block manually, then we return null to reset to the previous valid state. It should always be valid
  • if block is being created, then we generate new unique name instead. We will hit isDuplicate flag only if we copy-paste the block (as far as I understand at least)

Other code in validator_ function relies on this.editingInteractively check aswell, so it should be fine

Reason for Changes

Fix the issue with code generation

Test Coverage

N/A

Documentation

N/A

Additional Information

N/A

@LappiLappland LappiLappland requested a review from a team as a code owner May 13, 2026 18:45
@LappiLappland LappiLappland requested a review from lizschwab May 13, 2026 18:45
@github-actions github-actions Bot added the PR: fix Fixes a bug label May 13, 2026
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

Welcome! It looks like this is your first pull request in Blockly, so here are a couple of tips:

  • You can find tips about contributing to Blockly and how to validate your changes on our developer site.
  • We use conventional commits to make versioning the package easier. Make sure your commit message is in the proper format or learn how to fix it.
  • If any of the other checks on this PR fail, you can click on them to learn why. It might be that your change caused a test failure, or that you need to double-check the style guide.
    Thank you for opening this PR! A member of the Blockly team will review it soon.

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.

Duplicate argument names when copy pasting argument blocks

2 participants