Problem/Motivation
Adopting the Canvas Icon Picker across the Varbase site templates takes three pieces. The module install and its default icon packs go in Varbase Admin Base, once, for every template: #3620064. The theme opts its icon props in with x-canvas-icon: #3620070. This issue is the third piece.
This recipe ships 69 Canvas component configs, five of which pin the icon prop to the old list_string/options_select shape. Converting the theme alone gives new content the picker but leaves everything the recipe has already placed on the pre-conversion stored versions, which keep the old select.
Verified on a fresh RightUp install with the theme converted and this recipe untouched: each component has a new active version carrying the picker, while its stored versions are still on options_select.
Steps to reproduce
- Build a Varbase 11 site and install the RightUp site template with the theme change from #3620070 applied.
- Open a Canvas page and select a component the recipe placed, rather than one you added yourself.
- Its Icon field is still the old select list, because the instance is pinned to a pre-conversion stored version.
Proposed resolution
Re-export five Canvas component configs against the converted theme, and rewrite the icon prop to the picker shape on every stored version, not only the active one:
| config | new active version | curated ids |
|---|---|---|
canvas.component.sdc.vartheme_bs5_rightup.badge.yml |
60738022e738eef8 |
43 |
canvas.component.sdc.vartheme_bs5_rightup.button.yml |
7c8b7b626a4fbd83 |
51 |
canvas.component.sdc.vartheme_bs5_rightup.icon.yml |
9bc1e1a79ad3aca5 |
51 |
canvas.component.sdc.vartheme_bs5_rightup.icon-toggle.yml |
89c883e11d4f832c |
50 |
canvas.component.sdc.vartheme_bs5_rightup.card-icon.yml |
62345acf6ed14ba8 |
43 |
Rewriting the non-active stored versions is what does the work: content the recipe already placed then edits through the picker rather than the old select, with no content re-pinning and no update hook, which matters because a theme cannot implement hook_update_N.
Each config also gains canvas_icon_picker in its dependencies. options stays, because the other props on these components are still list_string.
This recipe does not install the module and does not set the packs: Varbase Admin Base does. The same change is already filed for the other two templates, Educare #3620058 and Horizon Aid #3620065, and the pattern there is worth copying: re-encode the files with Drupal's own Yaml::encode so the diff shows the real change rather than dumper reformatting.
What does not work, so nobody repeats it: deleting the configs so Canvas derives them fresh. On the other templates the shipped default content pins those exact component_version hashes and the install then fails at content import with 'icon' is not a supported key.
What was verified
On a fresh Varbase 11 build with the RightUp site template (Drupal core 11.4.5, PHP 8.4, Drupal Canvas 1.10.1, UI Icons 1.1.2, Canvas Icon Picker 1.0.3, RightUp 1.0.x-dev, RightUp theme 1.0.x-dev), with the theme converted and Varbase Admin Base installing the module:
- The install completes green.
canvas_icon_pickeris enabled, withallowed_packsreading back asbootstrap_icons,vartheme_social.- Each of the five components has a new active version on
canvas_icon_picker/stringwith the curated id counts above, and stored versions still onoptions_select, which is exactly what this issue fixes. - Anonymous requests to
/canvas-icon-picker/indexreturn 403.
Two unrelated things found on the same build, not fixed here
- The only Error-level log entries on a stock RightUp install come from
views.view.bloghardcoding the base theme namespace. Filed separately as varbase_blog_base #3620071. composer.jsonhere requiresdrupal/varbase_admin_base: 1.0.x-dev, a dev constraint. On a build carrying the released base recipes this does not resolve (found drupal/varbase_admin_base[1.0.x-dev] but the package is fixed to 1.0.0-rc1) and installs only with--with-all-dependencies, which drags every Varbase base recipe onto its dev branch. Worth its own issue; say the word and I will file it.
Drafted with AI assistance (AI-Generated: Yes), per the Drupal AI policy. Every claim above was verified by running it.
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
- In the Drupal Canvas editor, Icon fields on content this recipe already placed become a searchable icon picker with live previews instead of a select list of names.
- No change for site visitors.
API changes
- N/A
Data model changes
- Five
canvas.component.sdc.vartheme_bs5_rightup.*configs gain a new active component version and keep their previous versions, with theiconprop definition rewritten on those. Stored prop values are unchanged: both field shapes hold the same bare scalar.
Release notes snippet
- RightUp's Canvas component configs are re-exported for the Canvas Icon Picker, so icon fields on the pages and regions the template ships offer a searchable, visual picker. Requires the matching RightUp theme and Varbase Admin Base releases.
Issue fork rightup-3620072
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 #4
rajab natshahConfirming what this landed, from a verification build today.
Built
drupal/varbase_project:11.0.x-devwithddev composer require drupal/rightup:1.0.x-dev -W, Drupal 11.4.6, and installed the site template both withdrush site:installand through the browser site-template picker. RightUp is offered in the picker and the install completes: 118 of 118 steps.Baseline on that install: default theme
vartheme_bs5_rightup, 12 blog and 2 page nodes, 5 Canvas pages, 59 media, 85 RightUp SDC components, 0 error-severity watchdog rows, all Canvas pages and 12 of 12 article pages returning 200, no barevartheme_bs5:references left in configuration.Two findings from that build that are worth linking here.
The component configs this issue re-exported did not cover the props added by the theme work in #3619843. Eight components are still stale against the theme: divider, figure, icon-toggle, section, share, tabs, taxonomy and text. Any Canvas configuration that sets one of the newer props aborts the site install with
'icon_color' is not a prop on this version of the Component, and CI does not catch it because CI never installs from released Composer constraints. Filed with the full prop table as #3620712.The component version hashes are not reproducible across environments, which matters before pinning any of them. Comparing the hashes this branch ships against two independent installs: on the Varbase base 2 of 5 sampled components reproduce the shipped value exactly (card-icon and icon), while on a profile-less recipe-only install 0 of 5 do. The two installs differ by exactly one module, the
varbaseprofile itself, and share the same theme commit and the same 85 components. So the drift is component-specific as well as environment-specific, and a hash still needs proving across two genuinely identical module sets before it can be relied on.Comment #5
rajab natshahReleased in rightup 1.0.0-alpha1.
Comment #7
rajab natshah