Explicitly support `comment` as a referenceable content entity type (stop omitting it from the content entity types endpoint)
> **Follow-up of** [!1112](https://git.drupalcode.org/project/canvas/-/merge_requests/1112) — see [note 1106693](https://git.drupalcode.org/project/canvas/-/merge_requests/1112#note_1106693). ### Overview The content entity types endpoint lists which content entity types/bundles can be referenced. To decide eligibility it builds an unsaved **stub** entity per bundle and runs a `'view'` access check on it. For the `comment` entity type this check throws: `CommentAccessControlHandler::checkAccess()` dereferences the commented entity (`$entity->getCommentedEntity()`), which a bundle-level stub has no way to populate. To avoid one misbehaving entity type returning a 500 for the whole response, `getBundleViewAccess()` catches the throw and treats the bundle as forbidden. The result is correct (the endpoint returns 200) but conservative: **`comment` is silently omitted from the referenceable list**, even for a user who holds `access comments`. This is not about the `comment` *field* type (`CommentItem`), which only carries leaf metadata (`status`, `cid`, `comment_count`, `last_comment_*`) already handled as ordinary leaf properties. ### Proposed resolution Evaluate bundle-level reference eligibility for `comment` (and any entity type whose access handler needs a fully-formed entity rather than a stub) without depending on a stub the handler cannot operate on. The defensive `try/catch` in `getBundleViewAccess()` stays as a safety net, but `comment` should pass through it on its own merits instead of being dropped. ### Remaining tasks - Determine how to assess `comment` bundle access without a throwing stub (e.g. a comment-aware eligibility path, or access evaluation that does not require a commented entity). - Stop omitting `comment` from the content entity types endpoint when the user may view it. - Extend `ApiUiContentEntityReferenceControllersTest::testContentEntityTypesCatchesStubAccessThrow()` (or add a sibling test) to assert `comment` is now included. ### User interface changes `comment` becomes selectable as a reference target where it previously did not appear.
issue