Problem/Motivation

Nothing validates that the entity references in the recipe's default content actually resolve to entities the recipe ships. A Canvas component input can carry a CANVAS_ENTITY_REFERENCE to a media or file uuid, and a _meta.depends block can name one, without anything checking that the target is present in content/.

When a reference does dangle, entityRepository::loadEntityByUuid() returns NULL and Canvas asserts on it during the default-content import:

AssertionError: assert($entity instanceof EntityInterface)
  canvas/src/EventSubscriber/DefaultContentSubscriber.php line 204
  #1 DefaultContentSubscriber.php(187): processComponentInputOnImport()

That aborts the whole install, so the cost of a bad export is a site that cannot be built at all. A re-export is the easy way to introduce one: it can add a depends block and image references pointing at media that exist in the source site but were never exported into the recipe.

This is preventive, not a bug report. The 1.0.x branch is currently clean — all 22 CANVAS_ENTITY_REFERENCE targets in content/ resolve against the 183 uuids the recipe ships, 0 unresolved. The point is to keep it that way, because the failure mode is invisible until an install is attempted.

Steps to reproduce

There is nothing to reproduce on the branch; this is a gap in the checks, not a defect in the shipped content. The check can be demonstrated by pointing any CANVAS_ENTITY_REFERENCE in content/ at a uuid the recipe does not ship and confirming that nothing in the project currently objects until install time.

Proposed resolution

  • Add a check that walks every CANVAS_ENTITY_REFERENCE target_uuid and every _meta.depends entry in content/** and resolves each one against the uuids the recipe actually ships.
  • Fail with the offending file, uuid and target type named, so the message points straight at the export that broke.
  • Run it in CI so a re-export cannot ship a dangling reference.

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

User interface changes

  • N/A

API changes

  • N/A

Data model changes

  • N/A

Release notes snippet

  • Added a check that every entity reference in the recipe default content resolves to an entity the recipe ships, so a bad re-export cannot ship an install-breaking dangling reference.

AI-Generated: Yes

Comments

rajab natshah created an issue. See original summary.

rajab natshah’s picture

Issue summary: View changes
rajab natshah’s picture

Title: Install aborts: the African and African American Studies Canvas page depends on media and file entities the recipe does not ship » Add a check that every Canvas entity reference in the default content resolves to a shipped entity
Category: Bug report » Task
Issue summary: View changes
Priority: Critical » Normal

Retitled and rescoped this issue, and the correction is ours to own.

As originally filed this claimed a Critical, install-blocking bug on 1.0.x-dev. That claim was wrong. The issue was filed from a local working tree containing unreleased, uncommitted changes, and the defect it described exists only in that tree. Nobody reported it against the branch.

Re-verified with git show HEAD:content/canvas_page/683c9181-64f9-4a13-8ad9-59cd5d4eb89a.yml: on the branch that file has no _meta.depends block at all, and none of the four uuids the summary named (e6e035a6-ac8b-4655-85a8-cfa44ae25e98, 4641dee9-d33d-4ca2-ab65-2db9148f1fc5, 191fbcb1-256d-4b5f-ab38-02a7e50ee72d, 9b6d0f21-281f-49c0-990e-84045ca26f4b) appears anywhere in the tracked content/ or config/. The depends block and the two dangling media references were introduced by an uncommitted re-export locally. Corroborating this, the clean-room 1.0.x-dev install never hit the AssertionError — it failed later and for an unrelated upstream reason.

Rather than close it, the one genuinely useful part has been kept: a recipe-side guard that every CANVAS_ENTITY_REFERENCE in content/** resolves to a uuid the recipe ships. That is a real improvement to 1.0.x and would have caught the bad export before it went anywhere. The summary has been rewritten accordingly, the title now describes the guard, Category is now Task and Priority is now Normal. The branch itself is clean today: all 22 references resolve against the 183 shipped uuids, 0 unresolved.

AI-Generated: Yes