Hi,
based on the issue https://www.drupal.org/node/2885099 regarding revision support of references I would like to bring the idea of composite entities https://www.drupal.org/node/2822476 to your attention.
The basic idea of a composite entity is that it comprises multiple entities, their references on revision basis (instead of on node basis).
cer could prove the central element for that idea: by means of a configurable hierarchy or cascade of CERs.
Now cer allows for updating one reference on two entities:
A <-> B
A cascade could like this:
C <-> D
D <-> EThe basic purpose of it would be to propagate a coherent state of revisions from C -> E and E->C, depending whether C or E were changed.
Examples
In the example I take revision support of cer as given
Think of this situation showing the node revisions:
F (Rev 1) <-> G (Rev 1)
G (Rev 1) <-> H (Rev 1)Scenario a)
Changing a value on F - without a revision propagating cascade
-> changes the revision of F and updates the reference field of G, creating a new revision of G (since the reference on G must change it also causes a new revision).
Without a propagating cascade the reference pointing to H stays untouched. We'd have:
F (Rev 2) <-> G (Rev 2)
G (Rev 1) <-> H (Rev 1)Next change a value on G and you get:
F (Rev 3) <-> G (Rev 3)
G (Rev 3) <-> H (Rev 2)Next change a value on H and you get:
F (Rev 3) <-> G (Rev 3)
G (Rev 4) <-> H (Rev 3)Looking at it on a node basis it is correct. But if you want to go back in time you have lost the historical connections. At least I don't know a way of how to present the changes over the cascade.
Scenario b)
Changing a value on F - with a revision propagating cascade same steps as above, but the revisions get all updated if one of the cascaded entities gets a new revision:
- change the revision of F
F (Rev 2) <-> G (Rev 2)
G (Rev 2) <-> H (Rev 2)Next change a value on G and you get:
F (Rev 3) <-> G (Rev 3)
G (Rev 3) <-> H (Rev 3)Next change a value on H and you get:
F (Rev 4) <-> G (Rev 4)
G (Rev 4) <-> H (Rev 4)While the Revision Ids may of course not be identical (you may have connected a new entity to one that already exists with a number of revisions) you get the idea.
Whenever you want to "travel back in time" to see what was entered in a document and what it was referencing at that time is now possible - with a cascade that propagates revsions.
I have explained the importance of this mechanism in the complex composite entities issue.
cer is closest to this functionality - of all modules I know.
If cer would support revisions and configurable propagating hierarchies/cascades ... it would make drupal soo much more powerful than it is today.
P.S.: thank you for cer! it already makes life soo much better!
Comments
Comment #2
maxilein commentedComment #3
maxilein commentedComment #4
maxilein commentedComment #5
maxilein commentedComment #6
replicaobscuraThanks for this issue! It's been taking me some time to process this and try to think of the best way to handle this functionality.
I've prioritized the other issue, related to supporting Entity Reference Revisions, to be completed right after I finish creating a plugin abstraction for CER field types. After that, we should be able to implement this type of functionality into CER, provided I can get a solid plan in place.
Would you see this working within the configuration of each Corresponding reference configuration, if you're using it on a revisionable reference field, whether or not to make it cascading? And if it is cascading, how much control should there be over that (which entity types/bundles it cascades to, how many levels, etc)?
Thanks!
Comment #7
maxilein commentedThank you bmcclure! Sounds like a perfectly systematic approach.
I will think about your last paragraph.