[Feature:Forum] Pinned reply as announcement#12526
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #12526 +/- ##
============================================
- Coverage 21.64% 21.63% -0.01%
- Complexity 9861 9866 +5
============================================
Files 268 268
Lines 36920 36933 +13
Branches 495 495
============================================
Hits 7990 7990
- Misses 28439 28452 +13
Partials 491 491
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
|
Hi @JManion32 ! I have updated the "related to" - "closes" in the PR description. Yes there is a UI change, I have added a checkbox (next to anonymous to class checkbox) that makes sure that reply to a pinned thread can be send as an announcement. |
|
@JManion32 could you please review my PR? |
roye2
left a comment
There was a problem hiding this comment.
In my configuration (Linux + Firefox), when you click on the button to notify students, the browser confirmation popup appears multiple (5?) times even when you say yes for the first one. I am not sure why this is happening. I did test in Chrome and received the same issue.
Also, the button still does not explicitly say it will email the students with the notification. If email is enabled, it should say "Notify students (w/ email) (pinned thread reply)", as you stated previously in your PR, instead of just "Notify students (pinned thread reply)". This might mean that there is something wrong with the check on line 196 of ThreadPostForm.twig.
Otherwise, the changes of the code make sense to me and the feature seems to work as intended. I was able to verify that both the notifications and emails were sent correctly.
|
@jndlansh please include those screenshots in the PR description. |
Yes @JManion32, I have edited the PR description with the screenshots. |
|
Hey @roye2 @JManion32 ! I have fixed the issues raised by @roye2 : Multiple Popups : Now a single pop-up.
The Missing (w/email) Text :
Question : I want to ask, We tie this label |
roye2
left a comment
There was a problem hiding this comment.
I tested the updated functionality and found that the popup only displayed once and the wording next to the checkbox was updated correctly. Once you fix the linting error shown in the CI (extra instance of "email-enabled") I can approve this PR.
P.S. Sorry for the delay in my review!
roye2
left a comment
There was a problem hiding this comment.
I tested the functionality and it appears to work as intended. I also reviewed the code, and I just left a comment about some specific lines that I thought could be extraneous.
| "thread_announced" => $thread->isAnnounced(), | ||
| "show_reply_announcement" => $thread->isPinned() && $user->accessFullGrading() && $first, | ||
| "email_enabled" => $this->core->getConfig()->isEmailEnabled(), | ||
| "debug_thread_id" => $thread->getId(), |
There was a problem hiding this comment.
Are the debug_<...> lines here something you used for debugging that can be removed? Or does it actually serve a purpose in the functionality.
There was a problem hiding this comment.
Yes, they have served their purpose in debugging, now removed.
|
Yes these lines were added by me for temporary debugging and to to check if the correct thread or post was being processed. Thank you for pointing out, my bad! |
roye2
left a comment
There was a problem hiding this comment.
Okay, I've reviewed the code and the functionality. As far as I am concerned, everything looks good. Thanks for removing those extra bits.
Thank you @roye2 ! |
|
@jndlansh Please address these small changes so that I can rereview. Thank you! |
JManion32
left a comment
There was a problem hiding this comment.
Code changes and functionality work as expected. Replies to PINNED threads by an instructor can be marked as an announcement. Note: you cannot make an announcement on a thread that is not pinned.
|
@jndlansh Please fix merge conflict |
JManion32
left a comment
There was a problem hiding this comment.
Cypress tests are now passing. There is a failing forum test, but this is on every branch currently.





Why is this Change Important & Necessary?
Closes #12333
Related to discussion in the forum about improving announcement capabilities for pinned threads. Currently, when instructors reply to pinned threads (which often contain important announcements), the replies are sent as regular notifications that students may overlook. This feature allows instructors to send announcement-level notifications when replying to pinned threads, ensuring students receive the same level of notification as initial announcements.
What is the New Behavior?
When an instructor or TA replies to a pinned thread, they now see an additional checkbox option: "Notify students (w/email) (pinned thread reply)" or "Notify students (pinned thread reply)" depending on whether email is enabled.
Before:
After:
What steps should a reviewer take to reproduce or test the bug or new feature?
Automated Testing & Documentation
Other information
No Breaking : I verified the CI tests.

Migrations: None required - uses existing database schema and notification infrastructure
Security Concerns:
accessFullGrading()permission