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 is align-items-start | align-items-center | align-items-end.
  • columns_sm_size: 0408 — in featured_card_small, featured_card_medium and featured_card_large. The component's enum uses the NN_NN form, so this must be '04_08'. featured_card_xlarge already 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

  1. Install a site with the Varbase News Base recipe and some news content.
  2. Add a Views block whose row style renders the Featured card - medium view mode for news.
  3. Place that block on a page and view it as an anonymous user.
  4. The block renders empty; the rendered markup contains the Does not have a value in the enumeration error above.

Proposed resolution

Correct the invalid values in the five canvas.content_template.node.news.featured_card_*.yml files:

  • content_vertical_alignmentalign-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 h5 type 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_alignment and columns_sm_size values.
Command icon 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

rajab natshah created an issue. See original summary.

  • rajab natshah committed 17f70223 on 1.0.x
    fix: #3616334 Correct invalid card-featured prop values so the news...
rajab natshah’s picture

Issue summary: View changes
rajab natshah’s picture

Assigned: Unassigned » josebc
Status: Active » Needs review
Issue tags: +varbase_news_base-1.0.0-alpha2
rajab natshah’s picture

Assigned: josebc » mohammed j. razem
rajab natshah’s picture

Assigned: mohammed j. razem » Unassigned
Issue summary: View changes
Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.