Closed (won't fix)
Project:
Content Moderation Notifications
Version:
8.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
21 Nov 2018 at 10:19 UTC
Updated:
5 Dec 2025 at 08:15 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
Piegefull commentedComment #3
Piegefull commentedComment #4
Piegefull commentedComment #6
anruetherThanks a lot for starting this! The patch works for me, although I would expect that it is possible to add only one notification for all groups of a specified group type and not only for a single group. At least this is our use case...
The help text "Select which Group Role triggers this notification." under Group Role is misleading, shouldn't it mean "Send notifications to all users with these roles."?
Comment #7
Piegefull commentedA patch for the 8.x-3.0-rc2
@anruether Thanks for the feedback, Thats a good ideas to select a group type or for a selected group type an group entity.
If i got more time i'll try to implement this.
Comment #8
Piegefull commentedUpdate the group schema to a UUID from a ID.
Fix the codding standards and fix the module_handler service injection in the ContentModerationNotificationTest
Update the B.O. string with anruether suggestion
Comment #9
Piegefull commentedSame patch for 8.x-3.0-rc2
Comment #11
Piegefull commentedComment #12
Piegefull commentedFix a fatal error when selecting a group with fixed UUID.
Patch for 8.x-3.0-rc2
Comment #13
Piegefull commentedSame patch for 8.x-3.x-dev
Comment #15
Piegefull commentedFix a fatal error when load a group entity with specific UUID.
Patch for -rc2 version
Comment #16
Piegefull commentedSame patch for 8.x-3.x-dev
Comment #17
Piegefull commentedComment #18
Piegefull commentedAdd the group entity context in the Notification message for token.
Patch for the 8.x-3.0-rc2 version
Comment #19
Piegefull commentedSame patch for 8.x-3.x-dev
Comment #21
Piegefull commentedLate update after feedback on the mail sending for each user of the selected group.
Comment #22
grimreaperHello,
It should be a continue here and not a break. Because with the break, on the first group where the content is not related to, it will stop the notifications.
I will update your patch for that.
Comment #23
grimreaperComment #24
grimreaperInstead of looping on the entities of the group, I think it will be better to use group/src/Entity/Storage/GroupContentStorageInterface.php loadByEntity method. to get the group in which the entity belongs. And this calculation can be done outside the "foreach ($notifications as $notification) {" loop.
Comment #25
dgaspara commentedPatch to add group entity support to Content Moderation Notifications module and allows group roles configuration.
Comment #26
dgaspara commentedPatch to add group entity support to Content Moderation Notifications module and allows group roles configuration with some updates.
Comment #27
heddnComment #28
heddnHere's a straight re-roll of #23. Not sure where #25-26 are going, but there seems to be a lot of mention of a custom module embedded in those patches. So, let's switch back to #23.
Comment #29
heddnWithout any groups created, the notification add page WSOD. Here's a minor fix of that.
Comment #30
heddnI don't like I have to pick specific groups for notifications. I'd much prefer to pick a role for all groups of a certain type. Say I've got a Department group content type. Then all editor role members of the department group should be notified on configured transitions.
To that end, I'm going to scratch that itch and throw up a patch with that solution.
Still needs automated tests.
Comment #31
heddnComment #32
heddnRemoving out of scope changes. The remaining failing tests are the same as the ones identified in #3097199: Tests are failing against latest core. This is ready for review.
Comment #33
jhedstromCan this be done in a separate module via 3rd party settings and the alter hook provided by this module (
hook_content_moderation_notification_mail_data_alter)?Comment #34
sergiuteaca commentedWhen adding a new node to the group the
sendNotificationcomes before the content is attached to the group.Adding another option to find the
$groupfrom context providerComment #35
r-mo commentedLast patch gives an error on site-install
TypeError: Argument 7 passed to Drupal\content_moderation_notifications\Notification::__construct() must be an instance of Drupal\Core\Plugin\Context\ContextProviderInterface, null given
Adding null as default, along with some coding standards fixes.
Comment #36
josh.fabeanJust tried this patch and it appears to work as expected, due to scheme changes I had to reinstall the module to get it to save the settings but it's all working! Thanks for your work on this.
Comment #37
grimreaperHello,
I am currently updating a lot of contrib on the project we initially have created this issue with @Piegefull.
Thanks everyone for pushing it forward.
I am still stuck on group 8.x-1.0-rc2 but regarding the date of comment 35 this should not be a problem.
I have applied patch from comment 35 and I have a fatal error when the content is not in a group.
So here is an updated patch that add an if statement to check that a group entity i loaded.
I will pursue the tests.
Comment #38
grimreaperAlso regarding #3078110: Notification emails should not send to blocked users, is a similar check on user status should be done in setGroupData()?
Comment #39
grimreaperOk, I just realized two things:
Comment 30:
It depends of use cases. For the original use case of this issue, we had to configure notifications depending on specific roles for specific groups.
I am still testing if this new approach is incompatible with our use case.
Comment 33:
If this can avoid to have to maintain a patch and have the issue done, YES! But @jhedstrom, do you mean a sub-module into this project or a complete dedicated project?
Comment #40
grimreaperOk the new approach is working on my project too. I just had to block a lot of users and disable a lot of notifications to have my manual test isolated.
So updating the patch regarding my comment 38 on blocked users.
Also catched an unused variable. I think it was a copy paste error to ensure a variable is still initialized.
Comment #41
grimreaperI changed the config form a little to bit to exclude all internal roles except the member role.
As anonymous role is already excluded, as outsiders are not gathered when loading group members (by definition), and as the other roles created for each standard user roles are internal, it is not possible to give those rules in the UI so I think it gives a confusing config form otherwise.
Comment #42
josh.fabeanRe rolled patch on #41 to work with the latest dev.
Comment #43
caesius commentedThe last few patches use
3015275as the node ID in the filename. The issue node ID is actually3015276(I had to Google to find this issue).Comment #44
eleonelPatch re-rolled.
Comment #45
stella commentedI get the following error on the settings page with latest version of the module and Drupal 9.5.9
If I remove the check for isInternal() introduced in #41, then the page loads. However, it still has no group roles appearing on the form as a result of the rest of the change in #41 as I have no "member" role. I have editor and other roles, and none called "member", so I think that change is too restrictive and doesn't work for every scenario.
Comment #46
stella commentedUpdated version of the patch with the change from #41 rolled back.
Comment #47
stella commentedWhen testing the actual sending of the notifications I got this error:
This because the "group_content" entity has since been renamed to "group_relationship".
Updated patch attached for that one change.
Comment #50
naveenvalechaHere's the patch against the 8.x-3.7 version
The PR is opened for review
Comment #51
vistree commented@naveenvalecha,
after using your latest patch #50 I get an error on editiong and creating new group notifications:
Error: Call to undefined method Drupal\group\Entity\GroupRole::isInternal()The full message is:
Comment #52
skyredwangFollowing the suggestion from #33,
I turned the patch into a module: Group Content Moderation Notifications and with these additional changes:
Comment #53
bkosborneThank you for turning this feature into a contrib module.
This module is already pretty bloated with the number of options it presents users on who to notify. This would bloat it further. It's a slippery slope adding support for other contrib solutions in here. At some point it makes more sense to use a module like ECA which probably provides the flexibility needed, or use the new contrib module created in #52. I'm conflicted closing this because it's clear a lot of people want this functionality, but at the same time no maintainer has committed the work in many years and no tests have been added.
Comment #55
vistree commentedPatch from #50 does not apply to current 8.x-3.8 version. Should we provide a new patch or is it better to use the new submoudle provided in #52?