We have a Flag type plugin for nodes which adds two things:

- extra options for allowing flagging based on node authorship
- extra options for flagging with translations of nodes

Both of these things are now generic in D8:

- any entity can implement authorship with EntityOwnerInterface
- entities are generally translatable

How can we handle this?

Comments

joachim’s picture

Category: Task » Plan

Translation of entities now works at the field level. So whereas on D7 and previous, you'd have a 'translation set' formed of several different nodes, each one in a different language, on D8, the single node with just one ID has multiple language versions. So translation support for nodes isn't something we need to worry about any more: there is no more need to sync flaggings between translations. On the other hand, flagging only one translation of a node is no longer possible.

Then there's behaviour around the entity author. I think we should move this out of the node flag type plugin. Still pondering how.

socketwench’s picture

My first thought is to move the features you identified to the Entity flag type. Beyond that, not sure.

joachim’s picture

Yeah, that's the simplest way to do it.

We can detect whether an entity type has 'authorship' by whether it has a 'uid' in its entity_keys property (except for Comment... possibly a core bug, need to file).

I was getting ideas of having a 2nd plugin system for 'entity behaviours', and bringing plugins in automatically according to criteria -- somewhat like conditional traits. Which given we only have one such behaviour is probably a huge overkill :)

socketwench’s picture

Splitting this off into two smaller issues.