Problem/Motivation

Varbase Starter ships 21 Canvas Component config entities under config/canvas.component.sdc.vartheme_bs5.*.yml in a degenerate, unusable state. Every one of them is exported like this:

langcode: en
status: false
dependencies: {  }
active_version: fallback
versioned_properties:
  active:
    settings:
      last_active_version: ''
label: 'Views View List'
id: sdc.vartheme_bs5.views-view-list
provider: vartheme_bs5
source: sdc
source_local_id: 'vartheme_bs5:views-view-list'

active_version: fallback sends Drupal\canvas\Entity\Component::sourcePluginCollection() down the ComponentInterface::FALLBACK_VERSION branch, where line 231 does:

'slots' => \array_key_exists('last_active_version', $this->getSettings())
  ? $this->versioned_properties[$this->getSettings()['last_active_version']]['fallback_metadata']['slot_definitions']
  : [],

last_active_version is present but empty, and versioned_properties only has the key active, so $this->versioned_properties[''] is an undefined key. Every load of one of these entities emits three PHP warnings:

[warning] Undefined array key "" Component.php:231
[warning] Trying to access array offset on null Component.php:231
[warning] Trying to access array offset on null Component.php:231

These entities are loaded nine times each per install, so a single drush site:install of the recipe prints 189 + 378 = 567 warnings — 567 of the install's 593 output lines.

These files should never have existed. A fallback version is only ever created at runtime by Component::onDependencyRemoval(), which sets a real last_active_version; an empty one cannot be produced that way, so these were exported from a broken intermediate state. Canvas's own discovery never generates Components for these 21 — they are theme templates (form elements, regions, views wrappers), not editorial components — so nothing recreates them, and nothing in the codebase references them.

Steps to reproduce

mkdir -p my-drupal-site-varbase_starter && cd my-drupal-site-varbase_starter
ddev config --project-type=drupal11 --docroot=web
ddev composer create-project drupal/cms
ddev composer require drupal/varbase_starter
ddev drush si -y ../recipes/varbase_starter

Reproduced on Drupal CMS 2.1.4 / Drupal core 11.3, PHP 8.4, Varbase Starter 1.0.1, Canvas 1.4.x.

Proposed resolution

Delete the 21 config/canvas.component.sdc.vartheme_bs5.*.yml files, and remove their 21 matching canvas.component.sdc.vartheme_bs5.<name>: disable: [] actions from recipe.yml. Both halves have to go together: a disable action on config that is no longer imported fails the install with Entity canvas.component.sdc.vartheme_bs5.details does not exist.

The 21 names: details, field, fieldset, form, form-element, form-element-radiocheckbox, links-dropbutton, list, local-tasks, page, page-footer, radios, region, select, social-auth, user, views-view, views-view-grid, views-view-list, views-view-unformatted, views-view-summary.

Verified after the fix: a clean drush site:install of the recipe prints zero warnings and zero errors (23 lines of output, down from 593), reproduced three times. The site then has 104 Component config entities and none of the 21; the front page, /features, /blog, /about-varbase, /contact-us, /user/login, /canvas, the Canvas editor at /canvas/editor/canvas_page/2 and every admin route return 200; search returns 17 results with one linked heading per row; watchdog is clean.

The other three errors that install printed came from Varbase Admin Base and are already fixed and released in 1.0.2 (#3621823). This issue is only the 567 warnings.

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 varbase_starter-1.0.2

User interface changes

  • N/A

API changes

  • N/A

Data model changes

  • N/A

Release notes snippet

  • Removed 21 broken fallback Canvas component config files that made every install emit 567 PHP warnings.
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’s picture

Issue summary: View changes

rajab natshah’s picture

Status: Active » Needs review

Re-verified today on a fresh build:

mkdir -p ~/workspace/projects/my-drupal-cms-varbase-starter
cd ~/workspace/projects/my-drupal-cms-varbase-starter
ddev config --project-type=drupal11 --docroot=web
ddev composer create-project drupal/cms
ddev composer config minimum-stability dev
ddev composer require drupal/varbase_starter:1.0.x-dev
ddev drush si -y ../recipes/varbase_starter

Environment: Drupal CMS 2.1.4, Drupal core 11.4.6, PHP 8.4, drupal/canvas 1.11.0, drupal/vartheme_bs5 dev-5.0.x.

  • Before the fix: 567 warnings — 189 × Undefined array key "" and 378 × Trying to access array offset on null, all at Component.php:237. On the 1.0.1 / older-Canvas build the same warnings appeared at Component.php:231; the line moved, the defect did not.
  • After removing the 21 files and their 21 matching disable: [] actions: 0 warnings, 0 errors, install output down from 593 lines to 26.

So the fix holds on the dev branch and against current Canvas, not only against the release it was found on.

Worth noting so nobody mistakes it for a regression introduced by this change: that same dev-lane install then hits a separate, unrelated blocker, You have requested a synthetic service ("kernel"). It is not caused by this change — the stock drupal_cms_starter recipe fails the same way on the same codebase. Filed separately on the Drupal CMS development repository: drupal_cms work item 3591450.

Setting to Needs review: merge request !54 is open against 1.0.x and the change is now verified on both the released 1.0.1 and the 1.0.x-dev branch.

  • rajab natshah committed e73e0abb on 1.0.x
    fix: #3621845 Remove the 21 broken fallback Canvas component config...
rajab natshah’s picture

Assigned: rajab natshah » Unassigned
Issue summary: View changes
Status: Needs review » Fixed
Issue tags: +varbase_starter-1.0.2

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.