fix: #3619772 Re-export the Vartheme BS5 icon component config for the Canvas Icon Picker
Issue: #3619772 Editing a component 500s when a Vartheme BS5 icon prop drops its enum
Problem
Varbase Starter ships exported Drupal Canvas component config for five Vartheme BS5 components, pinning the icon prop to field_type: list_string with field_widget: options_select and an allowed_values_function that reads the prop's enum from the theme at runtime.
vartheme_bs5 !205 is merged and removed the enum from icon-toggle and bootstrap-icon. That callback now throws, and the component's edit form returns HTTP 500:
LogicException: `enum` is missing for schema of `icon` explicit input prop of `sdc.vartheme_bs5:icon-toggle`.Published pages still render; editing breaks. config/canvas.page_region.vartheme_bs5.header.yml pins icon-toggle, so this is every page of a new site.
Measured on a clean Varbase 11 install with the Varbase Starter site template: before !205, 0 of 11 stale versions would 500; after it, 2 would 500, 9 are safe.
Proposed resolution
Re-export the five component configs to the shape Canvas itself generates when the picker is active, in every versioned_properties entry including active:
field_type: string(waslist_string)field_storage_settings: { }(dropsallowed_values_function)field_widget: canvas_icon_picker(wasoptions_select)field_instance_settings.allowed_icon_pack: ['bootstrap_icons']expression: ℹ︎string␟value(wasℹ︎list_string␟value— the expression names the field type)
Plus field_instance_settings.allowed_icon_ids carrying each prop's curated enum, so the picker stays scoped to the designers' set rather than the whole pack:
| Component | Allowed icon ids |
|---|---|
| Button | 51 |
| Icon | 51 |
| Badge | 43 |
| Card icon | 43 |
| Icon toggle | none — !205 removed its enum, so the whole pack is correct |
Values were taken from the enum arrays at Vartheme BS5 5.0.x head 164179b8, in file order, filtered exactly as the module's alter hook does.
Two supporting lines
Naming field_widget: canvas_icon_picker makes this config depend on a module nothing in Varbase, Vartheme BS5 or Varbase Starter required, and without it the recipe install hard-fails. So this also adds:
"drupal/canvas_icon_picker": "~1.0.3"tocomposer.jsoncanvas_icon_pickertorecipe.ymlinstall:- the module in each file's
dependencies.module
Requirement
Needs Canvas Icon Picker carrying the #3619510 fix — the release after 1.0.3, or vardot/varbase-patches 11.0.40, which ships it today. allowed_icon_ids only exists as a config key with that fix; against stock 1.0.3 it would not validate.
Ordering
!205 is already merged, so this should land as soon as possible. Until it does, new Varbase Starter sites have a 500 on the header component's edit form.
Verification
gitlab-ci-localon the tree before pushing: Composer validate PASS, YAML lint PASS (173 files, 0 invalid).- Post-push re-read of all seven changed files from the branch: every file parses, every version hash intact, every non-
iconprop byte-identical,required/default_value/fallback_metadata/active_versionunchanged. - Each component's
default_valuewas asserted to be a member of its ownallowed_icon_ids(none,none,people,people), so nothing ships a default the picker would refuse. - Not verified: the recipe install itself. A full install run was not performed on this branch.
Open question for maintainers
The composer.json requirement currently sits on Varbase Starter. It may belong on Vartheme BS5 instead, since that is what declares x-canvas-icon. Flagging it as a maintainer call rather than asserting the placement is right.
AI-Generated: Yes
Checkpoints:
- File an issue
- Addition/Change/Update/Fix
- Testing to ensure no regression
- Automated unit testing coverage
- Automated functional testing coverage
- UX/UI designer responsibilities
- Readability
- Accessibility
- Performance
- Security
- Developer Documentation
- User Guide Documentation
- Reviewed by human
- Code review by maintainers
- Full testing and approval
- Credit contributors
- Review with the product owner
- Release notes snippet
- Release