Problem/Motivation
On the site where I am wanting to use this module, there are 14 notifications, two of which come from my own user's actions. If I have the "Skip Display to own activities" checkbox checked, I see no notifications. If I uncheck the box, I see two. None of the other 12 show.
Proposed resolution
The patch I am attaching shows me 12 items when I have "Skip Display to own activities" checked and 14 items when I have it unchecked.
Issue fork notificationswidget-3509746
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
andileco commentedComment #4
bramdriesenThanks for the merge request!
I don't remember by hearth how notifications are stored, so I'll need to manually test this change.
Comment #5
austin_brian commentedI was starting to think I was the only one unable to make this module work. I have the recommended configuration in the block.
- Notification content: As logged-in user
- Skip Display to own activities
But by default, after installing and uninstalling the module several times (both 1.x and 2.x versions) No notification showed.
If I turned off: Skip Display to own activities checkbox, a user would see notices for their own activities, but not other people's. Setting the block to show notifications "As Admin" seemed to show everything to everyone.
I applied the patch from @andileco, and that makes the module work as I expected it to. Authenticated users now see notifications of actions by other users.
I recommend merging this with the next module release.
Comment #6
bramdriesenThanks for testing. Merged and will tag a new release
Comment #8
tjhellmannWe applied the latest alpha today and the notifications counts for all of our users were all off, showing all notifications to all users. Tracking backwards it was this commit that caused the issue and specifically the part that removed this line from the query:
$query->condition('n.entity_uid', $uid);When that line is re-applied the notification counts are all correct again.In case it's helpful for context we're using the notifications_widget.logger service in a custom module to add a custom notification for each user in a comment thread (except the comment author) when a new comment is added.
Going to mark this as needs work in case others are experiencing the same thing.
Comment #9
bramdriesenHmm that should not happen. I think the whole if/else section could be simplified to also improve readability.
And o boy, what a bad variable naming happened when this module was created 😅
I think a small description for what "Skip Display to own activities" does would also help.