Skip to content

Commit 04540e0

Browse files
committed
Merge branch 'issues'
2 parents 207be8a + 3ca19b2 commit 04540e0

2 files changed

Lines changed: 15 additions & 33 deletions

File tree

mdl-examples/doctype-tests/17-custom-widget-examples.mdl

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
-- 3. COMBOBOX enum — Enum attribute (KNOWN BUG: CE1613)
1111
-- 4. COMBOBOX association — DataSource + CaptionAttribute (FIXED: Issue #21)
1212
-- 5. IMAGE basic — Default pluggable Image widget
13-
-- 6. IMAGE with URL — ImageUrl mode with dimensions
13+
-- 6. IMAGE dimensions — Custom pixel dimensions + alt text
1414
-- 7. IMAGE with OnClick — Action binding on click
1515
--
1616
-- Known engine bugs (do not affect MDL syntax correctness):
@@ -238,20 +238,22 @@ CREATE PAGE CWTest.P_Image_Basic
238238
}
239239
}
240240

241-
-- MARK: IMAGE with URL
241+
-- MARK: IMAGE with dimensions
242242

243243
-- ============================================================================
244-
-- Test 6: IMAGE with URL — ImageUrl mode with custom dimensions
244+
-- Test 6: IMAGE with custom dimensions
245245
-- Result: Pending validation
246246
-- ============================================================================
247247

248248
/**
249-
* Page with an Image widget configured in imageUrl mode,
250-
* displaying an external URL with fixed pixel dimensions.
249+
* Page with an Image widget with custom pixel dimensions.
250+
* Note: ImageUrl mode (imageUrl TextTemplate) is not yet supported —
251+
* the template's imageUrl property is null and cannot be created from
252+
* scratch without triggering CE0463.
251253
*/
252-
CREATE PAGE CWTest.P_Image_Url
254+
CREATE PAGE CWTest.P_Image_Dimensions
253255
(
254-
Title: 'Image URL',
256+
Title: 'Image Dimensions',
255257
Layout: Atlas_Core.Atlas_Default,
256258
Folder: 'CustomWidgets'
257259
)
@@ -260,8 +262,6 @@ CREATE PAGE CWTest.P_Image_Url
260262
ROW row1 {
261263
COLUMN col1 (DesktopWidth: 12) {
262264
IMAGE imgBanner (
263-
ImageType: imageUrl,
264-
ImageUrl: 'https://example.com/banner.png',
265265
AlternativeText: 'Company banner',
266266
WidthUnit: pixels,
267267
Width: 800,

mdl/executor/widget_engine.go

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -227,30 +227,12 @@ func setTextTemplateValue(val bson.D, text string) bson.D {
227227
if tmpl, ok := elem.Value.(bson.D); ok && tmpl != nil {
228228
result = append(result, bson.E{Key: "TextTemplate", Value: updateTemplateText(tmpl, text)})
229229
} else {
230-
// TextTemplate was null — create a new one
231-
result = append(result, bson.E{Key: "TextTemplate", Value: bson.D{
232-
{Key: "$ID", Value: mpr.IDToBsonBinary(mpr.GenerateID())},
233-
{Key: "$Type", Value: "Forms$ClientTemplate"},
234-
{Key: "Fallback", Value: bson.D{
235-
{Key: "$ID", Value: mpr.IDToBsonBinary(mpr.GenerateID())},
236-
{Key: "$Type", Value: "Texts$Text"},
237-
{Key: "Items", Value: bson.A{int32(3)}},
238-
}},
239-
{Key: "Parameters", Value: bson.A{int32(2)}},
240-
{Key: "Template", Value: bson.D{
241-
{Key: "$ID", Value: mpr.IDToBsonBinary(mpr.GenerateID())},
242-
{Key: "$Type", Value: "Texts$Text"},
243-
{Key: "Items", Value: bson.A{
244-
int32(3),
245-
bson.D{
246-
{Key: "$ID", Value: mpr.IDToBsonBinary(mpr.GenerateID())},
247-
{Key: "$Type", Value: "Texts$Translation"},
248-
{Key: "LanguageCode", Value: "en_US"},
249-
{Key: "Text", Value: text},
250-
},
251-
}},
252-
}},
253-
}})
230+
// TextTemplate was null in the template — skip.
231+
// Creating a TextTemplate from null triggers CE0463 because Studio Pro
232+
// detects the structural change. The template must be extracted from a
233+
// widget that already has this property configured in Studio Pro.
234+
log.Printf("warning: opTextTemplate: skipping null TextTemplate (cannot create from scratch without CE0463)")
235+
result = append(result, elem)
254236
}
255237
} else {
256238
result = append(result, elem)

0 commit comments

Comments
 (0)