In one of our site's workflows, I have notifications enabled only for node comments (not creation or update, via admin > messaging & notifications > events). However, when creating or editing a node, the team UI checkboxes show up, with an odd look because the notifications fieldset is not there (thus, there is no notification suppression checkbox, etc).

Let me know if any other information / testing is required.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Jose Reyero’s picture

Status: Active » Needs review
FileSize
1.72 KB

This patch checks for enabled comments for comment form.
For insert/update it adds the full fieldset when needed.

obrienmd’s picture

Status: Needs review » Needs work

On node creation and edit, this patch solves the secondary problem, which was the bad formatting, as it seems to add the notifications fieldset back when notifications for these events are actually disabled. This isn't the desired behavior, though... To me, the most desirable logic would seem to be:

On [node create, node edit, comment] form build, check if notifications are enabled for this action.
-If TRUE, add notifications_team UI, and notifications fieldset if needed.
-If FALSE, do not add notifications_team UI.

Does this make sense?

Jose Reyero’s picture

Committed the first patch, we can still work on the feature though.

About enabling disabling for creation/update the problem is you may want, when updating or creating a node to subscribe other users to comments (also when there are no notifications for create/update).

If we disable that option, then the only way you can subscribe other users to the node comments is by commenting on it. So I think it really makes sense as it is now (after the patch).

jmiccolis’s picture

Category: bug » feature

@obrienmd I'm on the fence as to what the default behavior should be. What don't quite understand is why you'd have "node creation" notifications disabled and "comment" notifications enabled. I'd like to hear more about the use case you're seeing here.

obrienmd’s picture

The use case for this is an internal processing system. We want users (some of whom never log in interactively, and/or are not allowed to) to be notified when a "comment" is added, because comments are generally added only when a response is required. When a node is created or edited, those actions do not require a response based on our procedures.

The use case is actually a non-issue, as by default, in notifications settings, all actions [create,edit,comment] are checked by default and would remain checked unless a site builder specifically wanted to disallow them. In the case where an administrator unchecked any of these settings, then notifications will not be sent on these actions regardless of whether or not the team UI shows up and/or users are "checked", making it an extraneous form element in these cases, whatever the administrator's motivations.

Jose Reyero’s picture

Status: Needs work » Fixed

Ok, implemented the whole thing. Now it only shows up for enabled events, when users will actually get a notification.

obrienmd’s picture

Confirming this is fixed. Thanks, Jose!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.