Page 1 of 1
2.2.14 news title problem - special characters
Posted: Sun Apr 12, 2020 5:41 pm
by jimbo1971
I have three sites running CMS made easy, and with the last one I installed 2.2.14.
There seemed to a bug concerning the title field. If you used some special characters like "-", then it was coded with - and that seemed to be stored in the database. Quite OK it every other code part agrees with the approach, but none of the templates I use and not even the news list with titles in Core seems to be in line with this. So I changed this behaviour in the action.addarticle.php and action.editarticle.php in modules back to the code that was there in 2.2.13:
[removed by admin]
I don't really understand what it the motivation behind the change that was made. I suspect it was made without proper testing (like putting all kinds of special characters into the title field and see what happens).
Any way, if somebody runs into this problem, there was a simple solution to it.
Re: 2.2.14 news title problem - special characters
Posted: Sun Apr 12, 2020 7:27 pm
by DIGI3
This was already reported here:
http://dev.cmsmadesimple.org/bug/view/12284
It will be fixed in a separate release of News soon, but for now you can use |unescape:'html' in your templates as a workaround.
Please note that core code changes are not permitted in the forum, please use the forge for that.
Re: 2.2.14 news title problem - special characters
Posted: Wed Apr 29, 2020 3:16 pm
by fowlerat
Does anyone know when the news modules bugs such as this will be fixed for 2.2.14? I have many users complaining and it's not giving CMSMS a good name. I dont want to have to go through all the templates and add code to escape the html. Surely this should be seen as an urgent fix as it has broken working sites?
Re: 2.2.14 news title problem - special characters
Posted: Thu Apr 30, 2020 9:04 am
by Rolf
We just released a new version of the News module via Module Manager. It will be available in a few hours at your website. Or download the XML at the Forge:
http://dev.cmsmadesimple.org/project/files/8
Re: 2.2.14 news title problem - special characters
Posted: Fri May 01, 2020 9:56 am
by fowlerat
Thanks Rolf. Has this fix been rolled into 2.2.14 or will the news module need updating after each upgrade? Regards.
Re: 2.2.14 news title problem - special characters
Posted: Fri May 01, 2020 2:07 pm
by DIGI3
We can't/wouldn't retroactively change an already released release. The module is released separately, and will also be included in the next cmsms release.
Re: 2.2.14 news title problem - special characters
Posted: Mon May 04, 2020 10:52 am
by fowlerat
Oh OK. That means that the current release you are advocating that people download to upgrade or install has a known problem. Surely you need a 'fix' release or at least advise that anyone using 2.2.14 has to also download and upgrade the news module?
Re: 2.2.14 news title problem - special characters
Posted: Mon May 04, 2020 3:44 pm
by velden
The new version of News will appear in Module Manager automatically. You should however go there yourself and decide to install or not.
Although this bug is annoying - like most of the bugs are - it is not a vulnerability. A fix has been released quickly and is available for all users.
In our opinion this is no reason to release a new version of CMSMS. When we release a new version, of course the News fixes will be included.
Re: 2.2.14 news title problem - special characters
Posted: Mon May 11, 2020 9:45 am
by howey
Hi
I had the problem with non standard characters being displayed as hex code. My simple fix was to change the way the title code was rendered in the template.
From this
Code: Select all
<a href="{$entry->moreurl}" title="{$entry->title|cms_escape:htmlall}">{$entry->title|cms_escape}</a>
to this
Code: Select all
<a href="{$entry->moreurl}" title="{$entry->title|cms_escape:htmlall}">{$entry->title}</a>
The first version is the code from the default tempalte. I would just be interested to know if by removing the cms escape will cause any problems or other issues.
Re: 2.2.14 news title problem - special characters
Posted: Mon May 11, 2020 10:19 am
by howey
Hi
I got the work around to get the page to display OK.
However it now seems that the variable I pass to the page to create the meta data og:title now has the hex code no matter hoiw I configure the template.
This is the code at the top of the template to set the variable
Code: Select all
{$canonical_url = $entry->canonical scope=global}
{$page_description = $entry->summary|default:$entry->content|strip_tags:false|strip|truncate:300 scope=global}
{$page_title = $entry->title|cms_escape:htmlall scope=global}
{$article_date = $entry->postdate|cms_date_format scope=global}
This is what renders in the header
Code: Select all
<meta property="og:title" content="Cut Energy Costs By 40% With Combined Heat and Power (CHP) "
Should read "Cut Energy Costs By 40% With Combined Heat and Power (CHP)"
This is after upgrading to the latest release of news, with CMSM 2.2.14
Re: 2.2.14 news title problem - special characters
Posted: Tue May 12, 2020 8:27 am
by howey
Hi
Being a bit of a "Norman".
Added
Code: Select all
{$page_title = $entry->title|unescape:"htmlall" scope=global}
and the meta data renders OK