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
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
Comment #3
rajeshreeputraRequesting review.
Comment #4
rohan-sinha commentedlgtm
Comment #6
rajeshreeputraMR merged!