Do not queue asset url parent content item when querying for asset url

Created on 30 January 2024, 5 months ago
Updated 14 June 2024, 12 days ago

Problem/Motivation

During the retrieval of an asset url, if only the system identifier of the item is passed to the function, the function does _more_ than retrieve the asset url; the function will also queue the item that holds the asset url.

  public function getAssetUrl(string $systemId, string $contentType = NULL) {
    // Get the content type of item if it was not passed in.
    if (is_null($contentType)) {
      $item = $this->orangeDamApi->getContentItem($systemId);
      $contentType = $item ? $item->type() : NULL;
    }

I don't believe we should be queuing the item just because we are trying to ascertain the content type of the item that has the asset url.

Proposed resolution

I think this can be fixed by replacing

-       $item = $this->orangeDamApi->getContentItem($systemId);
+       $item = $this->orangeDamApi->getSearchApiData($systemId)

Remaining tasks

User interface changes

None.

API changes

None.

Data model changes

None.

πŸ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States apotek

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

Comments & Activities

Production build 0.69.0 2024