- Issue created by @askibinski
- 🇪🇸Spain marcoscano Barcelona, Spain
In my experience this might be tricky and potentially complex to implement.
For example, in a scenario where the site is using content moderation, the last revision isn't necessarily the default, and when using workspaces (I know this might be a bit outdated, but in case it comes up again in the future), a non-default revision could even be "published" in a staging workspace, and just become published (and default) at an arbitrary future point.
In those cases, I fear that determining what "editors would expect to track" might not be easily generalizable, and could cause confusion.How about we implement a similar mechanism of a hook/event that sites could implement to ultimately alter what gets tracked and what doesn't?
- 🇳🇱Netherlands askibinski
Good points, I will change the title since I actually meant the default (active) revision.
I discussed this with SeanB yesterday and regarding content moderation: getting the default is a bit tricker but doable. But indeed: I'm not completely sure if messing around with the revisions will trigger entity track. Something to check.
Regarding workspaces: I have 0 experience with workspaces and haven't seen a project with it in real life, so personally I would be completely fine with checking whether workspaces module is enabled and disabling this option for incompatibility.
The hook is a good alternative. The only thing bothering me about it is that it would require coding on the user part. And I think that the scenario where you are only interested in the active revision is the 80% usecase which "normal" users would like to have?
I'll give it a stab with an option to see if I encounter any dragons.
- 🇳🇱Netherlands askibinski
@marcoscano
I think you might be right to do this in a hook. There are just too many variables on how people might have structured their content to do this reliably through 1 setting.For example, we would have to figure out for each entity whether its a "middle-layer" non-canonical content entity (like a paragraph) and then find out what the active revision is, which for a paragraph means getting the entity reference revision field of the top level entity because there is no way to reliably get this info from the paragraph itself (as far as I know).
But that's only a paragraph example.
- 🇳🇱Netherlands askibinski
Also, isn't it a bit weird that tracking of revisions is only done during a batch update?
- 🇳🇱Netherlands askibinski
Here is simple patch, for testing this with tracking default revisions only.
- @askibinski opened merge request.
- 🇳🇱Netherlands askibinski
Needs test though. See entity usage for a similar test. And we already have entity_track_test.module.
- Status changed to Needs review
over 1 year ago 8:16pm 22 February 2023 - Status changed to RTBC
over 1 year ago 10:51am 23 February 2023 - 🇪🇸Spain marcoscano Barcelona, Spain
Looks good to me! Thanks for working on this.
-
seanB →
committed 6a2473d8 on 1.0.x authored by
askibinski →
Issue #3338350: Provide a hook to block tracking
-
seanB →
committed 6a2473d8 on 1.0.x authored by
askibinski →
- Status changed to Fixed
over 1 year ago 6:24am 28 February 2023 Automatically closed - issue fixed for 2 weeks with no activity.