Don't generate a DANSE event if moderation states do not change

Created on 25 November 2022, over 1 year ago
Updated 23 June 2023, about 1 year ago

Problem/Motivation

Currently, the project page says โ€œ[โ€ฆ] DANSE Events will be created when [โ€ฆ] new content moderation entities are createdโ€. Actually, it turns out that it's not entirely true: the dev version on the 2.0.x branch subscribes to an ENTITY_UPDATE event (and not an ENTITY_CREATE one as the description suggests).

The onEntityUpdate() method of the module's event subscriber continues only when the type of given entity is core's content_moderation_state. As a result, this module always generates a piece of content_moderation type of DANSE event, because the content_entity_revision_id field of the content_moderation_state_field_data table is always being updated whenever a moderated content entity gets a new revision created. In other words, the HookEventDispatcherInterface::ENTITY_UPDATE event gets fired anyway if the content_moderation_state entity is updated (and it always does). This way there's no added value to generate a second type of DANSE event besides the original one already generated by the โ€œparentโ€ module.

In my opinion, this module would bring in extra business value if it would differentiate between the moderation states the content entity goes through during the given transition. To achieve that we need to figure out a more granular way of conditions to watch to be able to distinguish whether the content is really changed its publicity status or not.

๐Ÿ“Œ Task
Status

Fixed

Version

2.0

Component

Code

Created by

๐Ÿ‡ญ๐Ÿ‡บHungary Balu Ertl Budapest ๐Ÿ‡ช๐Ÿ‡บ

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024