2

Resolved

Orchard.Blogs : Archives month encodes localizations

description

In \Modules\Orchard.Blogs\Views\Parts.Blogs.BlogArchives.cshtml :
Html.Link(...) encodes the month Names
If I enabled the French culture and copied the localization .po files, the month names contains string likes this : Février so it appears like this when the list of archives is displayed.

A way to prevent this is to decode the month names with HttpUtility.HtmlDecode.

file attachments

comments

agriffard wrote Jul 26, 2012 at 2:52 PM

Patch provided

agriffard wrote Jul 26, 2012 at 3:35 PM

Same kind of error in Modules\Orchard.Blogs\Views\BlogPost\ListByArchive.cshtml
=> other complementary patch provided

sebastienros wrote Sep 21, 2012 at 11:10 PM

Should not be an issue anymore since localization is not encoding by default as it used to do

** Closed by sebastienros 09/21/2012 4:10PM

agriffard wrote Sep 22, 2012 at 10:47 AM

Month are still encoded int the latest version.


Repro :
Enable French culture and add fr-FR .po files.
Change timezone to GMT+1 Paris.
Create a blog
Add a blog archives widget in asidesecond on default zone.
Add a post with the date 01/01/2012 00:00.

=> The corresponding datetime in utc will be 31/12/2011 23:00 so the archives will display 'Décembre' and also in the archives path when you click on the filter link.

=> other request : Could the queries with dates take the current timezone in account?

agriffard wrote Sep 25, 2012 at 8:15 AM

The link are encoded because of the use of Html.Link().
In Orchard.Framework\Mvc\Html\HtmlHelperExtensions.cs, line 206 :
TagBuilder tagBuilder = new TagBuilder("a") { InnerHtml = htmlHelper.Encode(linkContents) };
Is the htmlHelper.Encode() mandatory for other usages or can we remove it ?
It would resolve the problem for any double encoded string ?

sebastienros wrote Sep 27, 2012 at 6:59 PM

Fixed in changeset 2f341afc7fc0