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.

Comments

syakely’s picture

Version: 6.x-1.x-dev » 6.x-1.2
Component: User interface » Code
StatusFileSize
new1000 bytes
new1.33 KB

With 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.

erik.ahlswede’s picture

These look great. They are exactly what I've been looking for.

Thanks,
Erik

syakely’s picture

This 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.

naheemsays’s picture

I 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.

naheemsays’s picture

Status: Active » Closed (fixed)

cross posted.

syakely’s picture

Version: 6.x-1.2 »
Status: Closed (fixed) » Active
StatusFileSize
new998 bytes
new1.39 KB

I 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

naheemsays’s picture

hm.. 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.

berdir’s picture

Status: Active » Needs work

- 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.

ptmkenny’s picture

Version: » 6.x-2.x-dev
Status: Needs work » Closed (won't fix)

Feel free to re-open if you update the patch as per #8.