Prevent usage registration for invalid Bynder asset_id

Created on 27 May 2025, 2 months ago

Problem/Motivation

When a media reference field accepts multiple media types (e.g., Image, Acquia DAM, and Bynder), the bynder_usage module attempts to register asset usage even if the selected media is not of type Bynder. In these cases, the media ID defaults to "default", which results in a 400 Bad Request response from the Bynder API:
"asset_id: 'default' is not a valid uuid"

Proposed resolution

Add a simple validation check before calling the usage registration API to skip any attempt when the asset ID is "default" or not a valid UUID. See attached .patch file.

🐛 Bug report
Status

Active

Version

4.3

Component

Code

Created by

🇧🇷Brazil filipeabreu Campinas/SP

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

Comments & Activities

Production build 0.71.5 2024