Skip to content

Fix operation error flash showing function source code instead of translated message#1775

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/fix-merge-error-message
Draft

Fix operation error flash showing function source code instead of translated message#1775
Copilot wants to merge 2 commits intomainfrom
copilot/fix-merge-error-message

Conversation

Copy link

Copilot AI commented Mar 2, 2026

When a disabled operation is triggered (e.g. merging incompatible features), the flash notification at the bottom of the map displayed raw JS source code instead of the localized error string.

Root cause: operation.tooltip (function reference) was passed to .label() instead of operation.tooltip() (its return value). flash.label() stores the value as _label and renders it via .html(utilSanitizeHTML(_label)) — when _label is a function, JS coerces it to its source via .toString().

// Before — passes function reference, renders as source code
.label(operation.tooltip)()

// After — calls the function, renders the translated string
.label(operation.tooltip())()

Affected files:

  • modules/behaviors/KeyOperationBehavior.js — keyboard-triggered operations
  • modules/modes/SelectOsmMode.js — click-triggered operations in OSM select mode
  • modules/ui/edit_menu.js — touch/pen interactions via the edit menu
Original prompt

This section details on the original issue you should resolve

<issue_title>Error message of Merge shows source code</issue_title>
<issue_description>### Description

When trying to combine lines and there is conflict, the error message shows the source code (seems the conflict condition judgement of Rapid).

Screenshots

Image

Version

2.5.6

What browser are you seeing the problem on? What version are you running?

Edge 144.0.3719.115

The OS you're using

Windows 10 Pro 19045.6809

Steps to reproduce

  1. Select multiple units that are conflict to merge (e.g. 1 line and 1 node)
  2. Press "c"
  3. The error message at the bottom shows the code instead of "Cannot merge ..." or other similar messages.

The browser URL at the time you encountered the bug

https://rapideditor.org/edit#map=15.88/22.7456/111.9104&background=EsriWorldImagery&id=w1222534190,w151235484

The auto-detected useragent string for your browser (leave blank if you're manually filling this form out)

No response</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: jenningsanderson <1637425+jenningsanderson@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix merge error message displaying source code Fix operation error flash showing function source code instead of translated message Mar 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error message of Merge shows source code

2 participants