Entity Actions for entities without canonical paths cause whitescreen (Commerce Payments)

Created on 14 November 2023, 8 months ago
Updated 30 November 2023, 7 months ago

Problem/Motivation

We created an SF mapping for Commerce Payment entities, a peculiar entity that doesn't have a canonical URL. Upon viewing the payment list for an order, we got a whitescreen:

"Drupal\Core\Entity\Exception\UndefinedLinkTemplateException: No link template 'salesforce' found for the 'commerce_payment' entity type in Drupal\Core\Entity\EntityBase->toUrl() (line 196 of core/lib/Drupal/Core/Entity/EntityBase.php)."

I tracked this down to salesforce_mapping_ui_entity_operation(), which only defines a LinkTemplate for entities that have a builder class AND a canonical path. Somewhere else there's logic that says "there's a mapping for this entity type, so load up the Salesforce path with the Action links."

Steps to reproduce

Create a mapping for an entity that doesn't have a canonical path, create a view of those entities that has the action links in it, view the view when there are entities in it.

Proposed resolution

I don't see why a canonical path should be required for having this link template -- it works fine without it. Perhaps it would make a little sense if we were using the canonical path to generate the Salesforce path, but we aren't (perhaps a separate thing to consider)

πŸ› Bug report
Status

Fixed

Version

5.0

Component

salesforce_mapping_ui.module

Created by

πŸ‡ΊπŸ‡ΈUnited States gcb

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024