Currently if an action has been carried out that can be "undone", the following text is shown:
The previous action can be undone.
This message is not entirely accurate as what the function does is the opposite of what was requested.
IMO a better text would be eg, for after marking the threads as read, the text should be "mark as unread".
In short, what is needed is a way to give more meaningful messages. For delete "undo" is accurate enough, but for marking as read it isn't.
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | improve-undo-messages-430382-6-module.patch | 1.39 KB | syakely |
| #6 | improve-undo-messages-430382-6-theme.patch | 998 bytes | syakely |
| #1 | improve-undo-message-430382-module.patch | 1.33 KB | syakely |
| #1 | improve-undo-message-430382-theme.patch | 1000 bytes | syakely |
Comments
Comment #1
syakely commentedWith the invite of "@todo: Provide a more flexible solution for such an undo action, operation defined string for example" in the code, I'm submitting patches to theme the messages on the bulk like operation privatemsg_operation_execute.
This module is very useful, Thanks!
SY.
Comment #2
erik.ahlswede commentedThese look great. They are exactly what I've been looking for.
Thanks,
Erik
Comment #3
syakely commentedThis has already been taken care of in the 6x-1.2-dev.
Edit: Confused myself this is not fixed in 6x-1.2-dev version.
Comment #4
naheemsays commentedI think this is the wrong way - it is not fixing the underlying issue were you can have a different undo/reversal text per operation. It is still restricted to a single text, but allows it to be replaced in the theme layer. This can already be done through translations.
Comment #5
naheemsays commentedcross posted.
Comment #6
syakely commentedI am not finding the cross post.
nbz, I am passing the operation to the theme function so a different message is sent (and can be changed) for the different operations. I may be missing your point. Please help me understand.
My last patch was made from the Recommended release.
I have attached patches for 6.x-2-dev
Thanks,
SY
Comment #7
naheemsays commentedhm.. I can see how it can be extended in the theme function there. But that is still limited by knowing all the possible variations of the text to display beforehand, so its not really extensible. If there are new operations added, the theme function would need to be extended.
A more extensible way would be to get the operation to provide the required text and then the translation layer can be used to replace it if needed.
Comment #8
berdir- Please provide a single patch, not multiple ones for each file. That does't work with automated testing
- If you provide a patch, set the status to needs review, then the patch is picked up and tested (there aren't tests for everything, but quite a lot now)
- I agree with nbz here. There is already a possibility to add a 'success message' to the $operation, we should add a 'undo message' key, and either output that or the existing default value.
- Additionally, instead of a theme function (The string is just outputted as a dsm() so there isn't much you can actually *theme*), we could add a drupal_alter('privatemsg_operation, $operation, ) to _privatemsg_execute_operation() that would allow to change anything from that operation, not only the undo message.
Comment #9
ptmkenny commentedFeel free to re-open if you update the patch as per #8.