Problem/Motivation

The AcquiaDamClient::search() method sends user-supplied queries directly to the DAM API without filtering by asset release/expiration status. This means it return unreleased or expired assets that should not be visible to end-users. Include an opt-in way to scope results to active (released and not expired) assets without manually appending query-syntax conditions (rd: / ed:) to the query string.

Proposed resolution

Add a new bool $released = FALSE parameter to AcquiaDamClient::search() that, when TRUE, appends a query condition filtering assets to those whose release date is before tomorrow and whose expiration date is either empty or after today:
rd:([before <tomorrow>]) AND ed:((isEmpty) OR [after <today>])

The date values are computed using the existing TimeInterface ($this->time->getCurrentTime()) already available in the client, formatted via \DateTime::format('m/d/Y') — no additional dependency injection is required.
This is a fully backward-compatible addition — existing callers continue to work unchanged since the parameter defaults to FALSE.

Issue fork acquia_dam-3605633

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

rajeshreeputra created an issue. See original summary.

rajeshreeputra’s picture

Status: Active » Needs review

Requesting review.

rohan-sinha’s picture

Status: Needs review » Reviewed & tested by the community

lgtm

  • rajeshreeputra committed 71d4f944 on 1.1.x
    Resolve #3605633 "Add $released filter parameter to AcquiaDamClient::...
rajeshreeputra’s picture

Status: Reviewed & tested by the community » Fixed

MR merged!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.