Problem/Motivation
Varbase Starter ships exported Drupal Canvas component configuration for the Vartheme BS5 components. Five of those files pin the icon prop to field_type: list_string with field_widget: options_select:
config/canvas.component.sdc.vartheme_bs5.button.ymlconfig/canvas.component.sdc.vartheme_bs5.badge.ymlconfig/canvas.component.sdc.vartheme_bs5.icon.ymlconfig/canvas.component.sdc.vartheme_bs5.card-icon.ymlconfig/canvas.component.sdc.vartheme_bs5.icon-toggle.yml
Every stored version in those files carries allowed_values_function: canvas_load_allowed_values_for_component_prop, which reads the prop's enum from the theme at runtime. When the theme's prop no longer declares an enum, the callback 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. It is editing that breaks.
Vartheme BS5 #3619736 (MR !205) adopts the Canvas Icon Picker and removes the enum from bootstrap-icon and icon-toggle. Measured on a clean Varbase 11 install with the Varbase Starter site template, with that change applied:
- Before the change: 0 of 11 stale versions would 500.
- After removing the two enums: 2 of 11 would 500, both
icon-toggle(c42c2d3c,5a87298f).
icon-toggle is the one that matters most, because config/canvas.page_region.vartheme_bs5.header.yml pins it, so it appears on every page of a new site.
Verified on Drupal core 11.4.5, PHP 8.4.20, Drupal Canvas 1.10.1, UI Icons 1.1.2, and Canvas Icon Picker 1.0.3 with the merged #3619510 fix.
Steps to reproduce
- Install Drupal 11.4 on Varbase 11 and pick the Varbase Starter site template.
- Apply Vartheme BS5 #3619736, which removes the
enumfrom the Icon Toggle component'siconprop. - Open any page in the Drupal Canvas editor and select the Icon Toggle component in the header region.
- The component edit form returns HTTP 500 with the
LogicExceptionabove. The rendered page is unaffected.
Proposed resolution
Re-export the five shipped component configuration files so the icon prop carries the shape Drupal Canvas generates for a prop that declares x-canvas-icon, in every versioned_properties entry including active:
field_type: stringwith an emptyfield_storage_settings, instead oflist_stringwithallowed_values_function.field_widget: canvas_icon_pickerinstead ofoptions_select.field_instance_settingsholdingallowed_icon_pack: [bootstrap_icons].expression: ℹ︎string␟value, to match the new field type.canvas_icon_pickeradded to each file'sdependencies.module.
The shape is read from the active configuration Drupal Canvas itself generates on a site where the picker is in place, not hand-written. default_value, required, every other prop and every version hash are unchanged.
Because the configuration now names the canvas_icon_picker widget, the module has to be present and installed for the recipe to import at all: drupal/canvas_icon_picker is added to composer.json and canvas_icon_picker to the recipe's install list. Without those two lines the recipe fails on a stock install instead of 500ing later.
This should land with or before Vartheme BS5 #3619736. If the theme change ships first, new Varbase Starter sites get a 500 on the header component's edit form until this follows.
Remaining tasks
- ✅ File an issue
- ✅ Addition/Change/Update/Fix
- ✅ Testing to ensure no regression
- ➖ Automated unit/functional testing coverage
- ➖ Developer Documentation support
- ➖ User Guide Documentation support
- ➖ UX/UI designer responsibilities
- ➖ Accessibility and Readability
- ❌ Reviewed by a human
- ❌ Code review by maintainers
- ❌ Full testing and approval
- ❌ Credit contributors
- ❌ Review with the product owner
- ❌ Update Release Notes
- ❌ Release
User interface changes
- The
iconprop of Button, Badge, Icon, Card Icon and Icon Toggle is edited with the Canvas icon picker instead of a select list.
API changes
- N/A
Data model changes
- The
iconprop is stored as astringfield instead of alist_stringfield. Values stay the bare Bootstrap icon ids already in use.
Release notes snippet
- Fixed a HTTP 500 on the Drupal Canvas component edit form when a Vartheme BS5 icon prop no longer declares an
enum, by re-exporting the five shipped icon component configurations for the Canvas Icon Picker.
AI-Generated: Yes
Issue fork varbase_starter-3619772
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
rajab natshahComment #5
rajab natshahComment #8
rajab natshah