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.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | entity_usage-test-revisions-3022265.patch | 7.98 KB | tinny |
| #2 | 3022265-2.patch | 2.13 KB | blazey |
Comments
Comment #2
blazey commentedHi, 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.
Comment #3
marcoscanoThanks for contributing!
I agree it can be useful. We should add test coverage for the new functionality though.
Comment #4
tinny commentedI've added tests for this.
Comment #6
marcoscanoThanks all for contributing to this, committed and pushed to 2.x-dev.