Skip to content

fix: ALTER SET writes a pluggable Boolean as "true"/"false", not "yes"/"no" - #1460

Merged
ako merged 1 commit into
mainfrom
fix/1454-pluggable-boolean-true-false
Oct 17, 2026
Merged

ako merged 1 commit into
mainfrom
fix/1454-pluggable-boolean-true-false

Conversation

@ako

@ako ako commented Oct 17, 2026

Copy link
Copy Markdown
Owner

Fixes #1327 (mirror of mendixlabs#1454).

Symptom (as reported)

alter snippet M.S { set (lazyLoading: false) on comboBox1; } stores PrimitiveValue = "no" (and "yes" for true). Studio Pro stores pluggable Boolean properties as "true" / "false".
… a bare true is stored as "yes", and the compiled client reads that as false. mx check and mxbuild both pass, and the property silently does the opposite.

Cause

setPluggableWidgetPropertyMut spelled every Go bool as yes/no, whatever the property's declared ValueType.Type. CREATE's own pluggable path (widget_engine.go) writes %t, so the two write paths disagreed.

Fix

The spelling now comes from the property's declared kind, the same way columnValueField already picks the value field:

  • Boolean → "true" / "false"
  • an Enumeration that declares yes/no keys keeps taking a boolean as those keys (the reporter's scan found 2.1k such values)
  • any other enumeration refuses a boolean and names its keys

TestSetWidgetProperty_PluggableWidget had pinned "no" on a fixture with no kind. It now asserts "false", with a comment.

Evidence

  • Control: with the fix stashed, TestSetPluggableBooleanWritesTrueFalse_1454 fails with PrimitiveValue = "yes", want "true".
  • Real run (blank 11.13.0 app, reporter's set (showFooter: true, clearable: false) on cbColor): the unfixed and fixed builds differ in exactly the two reported values ("no"→"false", "yes"→"true"). Both report The app contains: 0 errors., which is why only the stored bytes show the defect.
  • Regression script: mdl-examples/bug-tests/1454-alter-set-pluggable-boolean-true-false.mdl. Finding recorded.
  • make build && make test && make lint, make check-mdl and make check-findings all pass.

Side note, not fixed here: describe prints neither showFooter nor clearable for a combobox on either build, so the bug-test checks the result with bson dump.


Generated by Claude Code

…"/"no"

`alter page … set (showFooter: true, clearable: false) on cbColor` stored
PrimitiveValue "yes" / "no" (mendixlabs#1454). Studio Pro and the
widget template store a Boolean as "true" / "false", and the client reads
anything but "true" as false, so a bare `true` passed mx check and turned
the property off.

setPluggableWidgetPropertyMut now spells a bool from the property's
declared kind: Boolean -> "true"/"false"; an Enumeration that declares
yes/no keys keeps taking a boolean as those keys; any other enumeration
refuses a boolean and names its keys.

Control: with the fix stashed, TestSetPluggableBooleanWritesTrueFalse_1454
fails with `PrimitiveValue = "yes", want "true"`. On a blank 11.13.0 app the
unfixed and fixed builds differ in exactly the two reported values, and
both report 0 errors from mx check, which is why only the stored bytes
show the defect.

Refs #1327

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019httGxDh8UXt1Zoyh3Gh52
@ako
ako merged commit 49b2d6c into main Oct 17, 2026
31 checks passed
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.

[up#1454] alter ... set on a pluggable Boolean property writes "yes"/"no" instead of "true"/"false"

2 participants