Problem/Motivation

EntityUsage::listTargets cannot be used to fetch entities referenced at a specific point in time (e.g. right now). It always returns all the entities that were ever referenced by the $source_entity.

Proposed resolution

Add a second parameter $vid = NULL that, when provided, makes the method return only the targets from that particular revision.

User interface changes

None.

API changes

An additional, optional parameter in EntityUsage::listTargets

Data model changes

None.

Comments

blazey created an issue. See original summary.

blazey’s picture

Assigned: blazey » Unassigned
Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new2.13 KB

Hi, I've stumbled upon this one when building a module that depends on Entity Usage. The patch adds the ability to fetch targets for a given revision without changing the output of the method when called with a single argument.

marcoscano’s picture

Status: Needs review » Needs work
Issue tags: +Needs tests

Thanks for contributing!

I agree it can be useful. We should add test coverage for the new functionality though.

tinny’s picture

Status: Needs work » Needs review
StatusFileSize
new7.98 KB

I've added tests for this.

  • marcoscano committed 414e218 on 8.x-2.x authored by blazey
    Issue #3022265 by blazey, tinny, marcoscano: Make it possible to get...
marcoscano’s picture

Status: Needs review » Fixed

Thanks all for contributing to this, committed and pushed to 2.x-dev.

Status: Fixed » Closed (fixed)

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