- Issue created by @rclemings
- π©πͺGermany jurgenhaas Gottmadingen
There are some deliberate "force silent" scenarios:
\Drupal\danse_content\Plugin\Danse\Content::createContent
If a new and published entity gets saved, there are 2 events: create and publish. As we want to avoid double-notifications, the create event is enforced to silent.
\Drupal\danse_content\Plugin\Danse\Content::updateContent
If an existing entity gets updated and by the same time either gets published or unpublished, there are also 2 events: either update and publish or update and unpublish. Again, to avoid double-notifications, the publish or unpublish events are enforced to silent.
\Drupal\danse_content\Plugin\Danse\Content::deleteContent
If an existing entity gets deleted, there are 2 events: unpublish and delete. As above, 1 of those (here: unpublish) in enforced to silent.
While the intention to not double-notify still seems to be appropriate, I can see how notifications may be missing for those who subscribed to the silenced event and not the other. Not sure, if and how this can be resolved to satisfy both intentions, open for discussions.
- πΊπΈUnited States rclemings
I thought it might be something like that. Sorry I didn't dig deeper into the code first. It was getting late.
The only thing I would question is whether publish shouldn't force update to silent, instead of the other way around. Publish seems like the more important event to me, but maybe that's just because of my use case. (Same for unpublish.)
Trying to think this through ... if content is published, that's an update in itself (right?) so in that case, it's the update event that is superfluous.
Of course, there might be an additional update before the publish event, and the notification for that would be silenced if the content is then published before the next cron. How important is that? Beyond that, how many non-admins are going to request update notifications anyway?
On createContent and deleteContent, I think the existing design makes sense.
- π©πͺGermany jurgenhaas Gottmadingen
Trying to think this through ... if content is published, that's an update in itself (right?) so in that case, it's the update event that is superfluous.
I wouldn't agree to that. Yes, published in an update in itself, but that's why published could be recognized as redundant. The thinking behind that is that the published state is just another field (value: 0 or 1) like many others in entities as well.
Maybe we need to go to the stretch of finding out if the status field was the only change during an entity update. If so, we silence the update event; otherwise, we silence the publish/unpublish event.
Additionally, we could offer a global setting to disable the auto-silencing completely.