Ticket #1485676 (closed Bugs: fixed)

Opened 14 months ago

Last modified 13 months ago

wrong reply body for text message with html attachment

Reported by: alec Owned by: thomasb
Priority: 5 Milestone: 0.2.1
Component: Core functionality Version: 0.2-stable
Severity: normal Keywords: reply body html
Cc:

Description

I have a text/plain message with html inline attachment (m/mixed not m/alternative). When I try to reply with html editor enabled, body contains the html attachment contents instead of plain text part. I'm not sure that reply body should contain attachment body, but definitely should contain the message (text) body.

Attachments

rcube_message.php.patch (397 bytes) - added by linuxmagic 13 months ago.

Change History

  Changed 14 months ago by alec

...also shouldn't be washtml class used for html messages on reply/forward?

  Changed 13 months ago by linuxmagic

Haven't been able to reproduce this so far... was this with a particular browser? PHP version > 5.2 ?

follow-up: ↓ 4   Changed 13 months ago by alec

Sorry, the problem is with html message with html attachment. Steps to reproduce: 1. Create html message with html attachment. 2. Enable HTML editor by default. 3. Click reply to that message. Result: you have only attachment body in editor.

in reply to: ↑ 3   Changed 13 months ago by linuxmagic

Replying to alec:

Sorry, the problem is with html message with html attachment. Steps to reproduce: 1. Create html message with html attachment. 2. Enable HTML editor by default. 3. Click reply to that message. Result: you have only attachment body in editor.


Thank you for clarifying. There are actually two distinct issues here.

In the file program/include/rcube_message.php, the function "first_html_part()" is not breaking it's loop upon actually finding the first mimetype of 'text/html' - so it will always return the last. Adding a 'return' statement should resolve that.

The second issue is if a message has been drafted with a body of text/plain, but has an HTML attachment, then it will always show the attachment in the compose body. I'm not sure how that can be fixed though shy of ignoring any/all mime types and simply grabbing the first part, regardless of type - though that could be tricky.

I will attach a patch for the first_html_part() function.

Changed 13 months ago by linuxmagic

  Changed 13 months ago by alec

Patch applied in r2294. We still need fix for such drafts handling [1] and washtml'ing reply body [2].

  Changed 13 months ago by alec

Update: I've tested [1] issue and it works for me. Text/plain message with attachment is properly opened in non-html mode.

  Changed 13 months ago by alec

  • status changed from new to closed
  • resolution set to fixed

Fixed in r2301.

Note: See TracTickets for help on using tickets.