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

Created on 25 November 2022, about 2 years ago
Updated 23 June 2023, over 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.71.5 2024