Problem/Motivation

The current public method for retrieving content OrangeDamApi::getContentItem(), does not, contrary to method name, only retrieve the data, but it also queues the data, meaning that there is no public method by which a user of this module can simply retrieve the data to be queued without queueing it.

While the default workflow of this module works with queuing, there are circumstances where once might desire to simply retrieve the data without queuing it. For instance, one might want to save an item for reference, or for testing.

Steps to reproduce

Call OrangeDamApi::getContentItem(). Item will be queued, even if you only wanted to retrieve it. Since there are no other public methods that simply retrieve the item, a user has to code their own-reimplementation without the queuing part, which of course is less DRY and is error prone.

Proposed resolution

1. Remove queueing operations from getContentItem()
2. Create new public method queueContentItem() which wraps around getContentItem() and also queues the item.
3. Make sure next release is versioned as a breaking api change (1.7).

Remaining tasks

Create a merge request with the above changes.

API changes

Users will have to convert any existing calls to getContentItem() to use queueContentItem().

Data model changes

na

Issue fork orange_dam-3439306

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

apotek created an issue. See original summary.

apotek’s picture

Status: Active » Needs review
markdorison’s picture

Status: Needs review » Reviewed & tested by the community

LGTM!

apotek’s picture

Status: Reviewed & tested by the community » Fixed

  • apotek committed 989b7374 on 1.x
    Issue #3439306 by apotek: Provide public method to retrieve data only
    

Status: Fixed » Closed (fixed)

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