When I press Preview button reply form just disappears and I need to go back to see it. This problem only exists on messages/view/[number] page.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

litwol’s picture

Version: » 6.x-1.x-dev
Berdir’s picture

Title: Textfield hides on preview » Bugs in new/reply form
FileSize
3.33 KB

I assume this was broken by my recent patch..

When debugging this, I found out that there are actually multiple bugs...

- The mentioned visibility issue. Happens because $recipient_list is overwritten by an empty value and then '#access' is set to FALSE

- blocked recipients are not removed from the form because the call was wrong (the block implementation assumes that the key is the uid)

- There was a notice regarding the recently added read_all flag when sending a new message.

- When all recipients were blocked, the current user was displayed as only recipient. The form should be hidden in that case.

Berdir’s picture

Status: Active » Needs review
NaheemSays’s picture

Status: Needs review » Reviewed & tested by the community

looks good to me - it works and the changes look sensible. the addition of $blocked also make the "reply to self" function work how it is meant to instead of being cheeky in its implementation.

mr.alinaki’s picture

Patch works for me. Thanks!

mr.alinaki’s picture

Patch works for preview button, but I can't "reply to myself".

NaheemSays’s picture

FileSize
3.67 KB

ok, it took me next to forever finding that bug. Attached patch should fix it. My modification:

-    if (isset($message['recipients'][$form_state['values']['author']->uid])) {
+    if (isset($message['recipients'][$form_state['values']['author']->uid]) && count($message['recipients']) > 1) {

as otherwise messages to self are broken when you are the only recipient.

litwol’s picture

Status: Reviewed & tested by the community » Needs review

need review for #7. i'll commit it after next rtbc.

Berdir’s picture

Status: Needs review » Reviewed & tested by the community

Tested, the change does fix the bug.

The change is required because the new code does remove the author as recipient unless (added by this patch) he is the only recipient.

litwol’s picture

Status: Reviewed & tested by the community » Fixed

cheers

litwol’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev
Status: Fixed » Patch (to be ported)

oops

Berdir’s picture

Status: Patch (to be ported) » Reviewed & tested by the community
FileSize
3.19 KB

Patch almost applied to D7, just the small change in pm_block_user had to be rerolled and I already fixed one thing (the read_all form element placement) in D7 while porting, it seems.

litwol’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.