- 🇫🇮Finland anaconda777
Hi,
Is this intendet behaviour:
- When accessing URL /private-message/create it gives you option to add multiple recipients one by one.
(Altough the functionality changes a little when the same URL is opened to a modal) - When accessing url /private-message/create?recipient=167 there is no option to add multiple recipients, BUT if you open that to a modal, there is! And when you try to add more recipients, it does not work but gives error.
Also if you open this URL /private-message/create?recipient=167 you can remove the recipient by clicking the "X"
but then you are not able to add anyone anymore back to the recipient fileld. So that "X" should be removed. - When accessing URL /private-message/create it gives you option to add multiple recipients one by one.
- 🇳🇱Netherlands sebastian hagens Breda, Netherlands
Sending a private message to multiple users does not work.
- Drupal version 10.2.4
- Private message version 3.0.0A private message entity is only created and send to the last added user.
- Merge request !106fixed the selectors for the members field widget for adding multiple recipients → (Open) created by sebastian hagens
- Status changed to Needs work
10 months ago 3:30pm 7 March 2024 - 🇳🇱Netherlands sebastian hagens Breda, Netherlands
The patch at https://git.drupalcode.org/project/private_message/-/merge_requests/106.... will work against the current 3.0.0 release.
- 🇳🇱Netherlands eelkeblok Netherlands 🇳🇱
This sounds slightly different from the original bug report. Can we maybe get the issue summary fleshed out a bit, with steps to reproduce?
- 🇳🇱Netherlands sebastian hagens Breda, Netherlands
@eelkeblok or start a seperate issue?
- 🇳🇱Netherlands eelkeblok Netherlands 🇳🇱
For #14, yes, definitely. I was responding to your last set of comments, though 🙂
For #15, I was confused by you saying that it is the last user added. Re-reading the summary and your comment, "the first user" and "the last user added" might not be fully mutually exclusive (not sure how recipients get added to the widget, but depending on that, the last one you add might actually appear as the first one in the list of users). Long story short, I think this issue would benefit from a more thorough issue summary, including some steps to reproduce. If those are created from a clean install of the module (e.g. https://simplytest.me), we can also be sure that it doesn't depend on any data in whatever system is being used to test.
- 🇫🇷France nishruu
We have the same problem on our website. I tested the one line strictly related to the issue in #18 and it fixes the problem.
Steps to reproduce :
- Create a new thread at /private-message/create
- Add an user by searching its username and clicking it
- Add multiples users
- Send the message
- The behavior is erratic and you end up with one user (the last one searched), sometimes two, but never the full list of users you choose.Proposed resolution :
It's easier to see what's happening when you remove the "display: none" on the #edit-members-wrapper element.
With the current code, when you add a new user, at one point the list of members in this hidden input is reset, with only the last member added in it. It should not be.$('#private-message-add-form .form-submit').mousedown();
This selector in the current code seems too broad. It selects all the .form-submit elements in the form instead of selecting only the input used to add an empty form element to the hidden member list, as this comment explain :// The username cannot be inserted, so the 'add element' link is clicked // and the username is set to be entered upon ajax complete.
The update proposed by @sebastix in #18 (thanks Sebastian !) fixes it by targeting the right button instead of triggering mousedown on all these inputs. After apply this change, the behavior is always right. Adding and removing users works well.
Hope I'm helping. Do you need other info @eelkeblok ? The MR no longer apply to the current 3.0 but maybe you can update it or I can do a new one.
- 🇵🇱Poland alorenc Wolsztyn, 🇵🇱
We are in the process of refactoring this widget, dropping JS code and replacing it with standard Drupal functionality. Please see #3487692 for further details.
- 🇫🇷France nishruu
Glad to read that and I will follow the progression there.
In the meantime, I post this patch for anyone wanting to fix the bug while we wait for the replacement, as it can impact a lot of websites like ours. - 🇫🇷France nishruu
Glad to read that and I will follow the progression there.
In the meantime, I post this patch for anyone wanting to fix the bug while we wait for the replacement, as it can impact a lot of websites like ours.