Problem/Motivation
The Figure component cannot be used in a Drupal Canvas content template. Its component entity carries no prop definitions for the active version, so binding a field to number aborts the site install:
There were validation errors in canvas.content_template.node.country.full:
- component_tree.<uuid>.inputs.<uuid>.number: Component <uuid>: the number prop is not defined.
Setting any of the component other documented props fails the same way:
'number_color' is not a prop on this version of the Component 'Single-directory component: Figure'.
The component works when it is placed on a canvas page with literal values, so only the field-bound, template path is affected. A key-figures section therefore has to be built out of Heading and Text components instead of Figure.
Steps to reproduce
- Add a Canvas content template for any bundle.
- Place the Figure component in it and bind
number and description to fields.
- Apply the recipe or save the template: validation fails with "the number prop is not defined".
Proposed resolution
Declare the Figure component props so its active version exposes them to Canvas, and confirm a content template can bind number and description to entity fields.
Remaining tasks
- ✅ File an issue about this project
- ❌ Addition/Change/Update/Fix to this project
- ❌ Testing to ensure no regression
- ➖ Automated unit/functional testing coverage
- ➖ Developer Documentation support on feature change/addition
- ➖ User Guide Documentation support on feature change/addition
- ➖ 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 Figure component can be used for key figures on node pages, not only on canvas pages.
API changes
Data model changes
Release notes snippet
- Fixed the Figure component so its props are available to Drupal Canvas content templates.
Comments
Comment #2
rajab natshahNot pursuing this for now, so closing.
Where it came up: the four how-we-deliver cards on a Horizon Aid programme page take their glyph from the Icon Text Card’s
icon_imageprop. The value is stored correctly incanvas.content_template.node.program.full, but an object prop does not reach the template, so the component’s ownicon_image.src is definedguard never passes and no icon renders. String props on the same component are unaffected.Those cards now place the Icon atom inside the card’s content slot instead, which takes a string icon name and renders. That covers the need without this change.
Reopen if the design’s tinted icon tiles are wanted, since those need the object prop.