Problem/Motivation
Every one of the five news featured-card content templates ships prop values that the card-featured component does not allow, so the whole featured-card family fails to render. Any view or Canvas page that uses one of these view modes renders nothing but a Twig error:
Twig\Error\RuntimeError occurred during rendering of component ... in Content template News post content items — Featured card - medium view (node.news.featured_card_medium): [vartheme_bs5_educare:card-featured/content_vertical_alignment] Does not have a value in the enumeration ["align-items-start","align-items-center","align-items-end"]. The provided value is: "justify-content-center".
Two separate invalid values are involved:
content_vertical_alignment: justify-content-center— in all five templates. The component's enum isalign-items-start | align-items-center | align-items-end.columns_sm_size: 0408— infeatured_card_small,featured_card_mediumandfeatured_card_large. The component's enum uses theNN_NNform, so this must be'04_08'.featured_card_xlargealready carries a correctly quoted'06_06', which confirms the intended form.
The defect stayed invisible because nothing shipped so far actually used these view modes — pages hand-placed static card-featured components instead of rendering the view mode.
Steps to reproduce
- Install a site with the Varbase News Base recipe and some news content.
- Add a Views block whose row style renders the
Featured card - mediumview mode for news. - Place that block on a page and view it as an anonymous user.
- The block renders empty; the rendered markup contains the
Does not have a value in the enumerationerror above.
Proposed resolution
Correct the invalid values in the five canvas.content_template.node.news.featured_card_*.yml files:
content_vertical_alignment→align-items-center(all five).columns_sm_size→'04_08'(small, medium, large).
While the medium template is open, also bring it in line with the design it renders: the date belongs above the title, the title at the h5 type step, and the date at fs-6 in text-muted so it reads as metadata rather than a second heading.
Verified by rendering a real news node in all five view modes — all five render with the title present, and the previously failing markup is error-free.
Remaining tasks
- ✅ 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 varbase_news_base-1.0.0-alpha2
User interface changes
- The news featured cards render at all, where previously they rendered nothing.
- In the medium card the date sits above the title, smaller and muted, and the title uses the
h5type step.
API changes
- N/A
Data model changes
- N/A
Release notes snippet
- Fixed the news featured-card view modes, which could not render because of invalid
content_vertical_alignmentandcolumns_sm_sizevalues.
Issue fork varbase_news_base-3616334
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 natshahComment #5
rajab natshahComment #6
rajab natshahComment #7
rajab natshah✅ Released varbase_news_base-1.0.0-alpha2