This project is archived and is in readonly mode.
simple_format behaviour changed when used in Mailer view
Reported by Chris Powell | March 3rd, 2011 @ 08:38 PM | in 3.1
New (3.0.5) simple_format method in ActionMailer::MailHelper hides the one in ActionView::Helpers::TextHelper and has different behaviour:
A text block containing newlines/blank lines is now formatted into a single line.
I think it might be simply a case of renaming the Mailer simple_format to something else?
Comments and changes to this ticket
-
mat March 8th, 2011 @ 08:14 PM
Yeah, this is pretty poor form... here's the commit: https://github.com/rails/rails/commit/4083e0ea2ae6f87929a32935122f2...
Pretty much just need to rename the method.
-
José Valim March 8th, 2011 @ 09:50 PM
- State changed from new to resolved
- Milestone set to 3.1
- Assigned user set to José Valim
- Importance changed from to Low
Applied.
-
Xavier Shay March 9th, 2011 @ 10:40 PM
Any reason this can't be in 3-0-stable? There is an additional regression in that this method now raises on nil, whereas it used to return a blank string.
-
Xavier Shay March 9th, 2011 @ 10:44 PM
Further, since this is only a private refactoring, there is no public or even semi-public interface to worry about breaking.
-
visnu March 9th, 2011 @ 10:52 PM
+1 on bringing it into 3-0-stable. I'm sitting at 3.0.4 due to this bug in 3.0.5 (and having used simple_format in mailer templates).
-
Jason T Johnson March 10th, 2011 @ 07:44 PM
This is also breaking my mailer templates, since the original method expects the second argument to be a hash and the one in MailHelper expects a fixnum. (I started getting "comparison of Fixnum with Hash failed" exceptions.)
-
Bayan Khalili April 13th, 2011 @ 07:25 AM
+1 to bring this back to 3.0-stable. This is where the problem was introduced, and I don't see a good reason why it can't be backported.
-
Ricardo Panaggio May 2nd, 2011 @ 04:35 PM
We'll maintain a patched fork for that until it's backported: https://github.com/umamao/rails
We're using 3.0.7, so I only patched the respective branch. If you need any older branch, let me know.
-
Arthur Klepchukov May 8th, 2011 @ 11:31 PM
Without downgrading back to 3.0.4, I'm doing the following in my ActionMailer views to have access to the original simple_format:
ActionView::Base.new.simple_formatIf there's a better or easier way, please share :)
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>