Problem/Motivation

Once installed and configured, every request for a site page other than admin pages, generates the following error:
The component "varbase_components:badge" declared [content] both as a prop and as a slot...in Drupal\sdc\Component\ComponentValidator->validateDefinition() (line 67 of C:\...\docroot\core\modules\sdc\src\Component\ComponentValidator.php)

If I change the name of the slot in badge.component.yml on line 48, the error then happens with another component, varbase_components:button. I'm sorry, but I don't know the implications of just changing all the slot items that match properties or if they should be able to have the same name.

Steps to reproduce

Given a new clean install of varbase 10 alpha1 (on Apache httpd-2.4.47-win64-VS16, Win11, php 8.1.7)
When browser requests a site page
Then the above error message is added to watchdog log and user gets the standard try again later error message.

Proposed resolution

  • Make sure to use different names for props and slots.

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
  • ✅ Accessibility and Readability
  • ✅ Code review from 1 Varbase core team member
  • ✅ Full testing and approval
  • ✅ Credit contributors
  • ✅ Review with the product owner
  • ✅ Update Release Notes and Update Helper on new feature change/addition
  • ✅ Release Varbase 10.0.0-alpha2, varbase_components-2.0.0-alpha5

Varbase update type

  • ✅ No Update
  • ➖ Optional Update
  • ➖ Forced Update
  • ➖ Forced Update if Unchanged

User interface changes

  • N/A

API changes

  • N/A

Data model changes

  • N/A

Release notes snippet

  • Issue #3364276 by cmbp: Fixed Error in Varbase Components - declared in both as a prop and as a slot

Comments

cmbp created an issue. See original summary.

rajab natshah’s picture

Project: Varbase - The Ultimate Drupal CMS Starter Kit (Bootstrap Ready) » Varbase Components
Version: 10.0.0-alpha1 » 2.0.x-dev
rajab natshah’s picture

Title: Error in components - props and slots » Fix Error in components - props and slots

Thanks, Chris, for reporting this issue.
I confirm the issue

The website encountered an unexpected error. Please try again later.

Drupal\sdc\Exception\InvalidComponentException: The component "varbase_components:badge" declared [content] both as a prop and as a slot. Make sure to use different names. in Drupal\sdc\Component\ComponentValidator->validateDefinition() (line 67 of core/modules/sdc/src/Component/ComponentValidator.php).

Only getting this error with headless automated testing

rajab natshah’s picture

Title: Fix Error in components - props and slots » Fix Error in Varbase Components - declared in both as a prop and as a slot
rajab natshah’s picture

Issue summary: View changes

  • Rajab Natshah committed a275b811 on 2.0.x
    Issue #3364276: Fix Error in Varbase Components - declared in both as a...

  • Rajab Natshah committed b5d8c784 on 2.0.x
    Issue #3364276: Fix Error in Varbase Components - declared in both as a...
rajab natshah’s picture

Issue tags: +varbase-10.0.0-alpha2
rajab natshah’s picture

The website encountered an unexpected error. Please try again later.


Drupal\sdc\Exception\InvalidComponentException: [props.properties] NULL value found, but an object is required in Drupal\sdc\Component\ComponentValidator->validateDefinition() (line 118 of core/modules/sdc/src/Component/ComponentValidator.php).

  • Rajab Natshah committed 296a4cde on 2.0.x
    Issue #3364276: Fix Error in Varbase Components - declared in both as a...

  • Rajab Natshah committed f28d573b on 2.0.x
    Issue #3364276: Fix Error in Varbase Components - declared in both as a...

  • Rajab Natshah committed b97eaaa9 on 2.0.x
    Issue #3364276: Fix Error in Varbase Components - declared in both as a...
rajab natshah’s picture

Assigned: Unassigned » mohammed j. razem
Issue summary: View changes
Issue tags: +varbase_components-2.0.0-alpha5
rajab natshah’s picture

Assigned: mohammed j. razem » Unassigned
Status: Active » Needs review
rajab natshah’s picture

Status: Needs review » Fixed
rajab natshah’s picture

Issue summary: View changes
rajab natshah’s picture

Issue summary: View changes

Status: Fixed » Closed (fixed)

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