2.2.14 news title problem - special characters

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
jimbo1971
New Member
New Member
Posts: 1
Joined: Sun Apr 12, 2020 5:30 pm

2.2.14 news title problem - special characters

Post 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.
User avatar
DIGI3
Dev Team Member
Dev Team Member
Posts: 1627
Joined: Wed Feb 25, 2009 4:25 am
Location: Victoria, BC

Re: 2.2.14 news title problem - special characters

Post 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.
Not getting the answer you need? CMSMS support options
fowlerat
Forum Members
Forum Members
Posts: 30
Joined: Mon Mar 07, 2011 1:02 pm

Re: 2.2.14 news title problem - special characters

Post 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?
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Location: The Netherlands
Contact:

Re: 2.2.14 news title problem - special characters

Post 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
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
fowlerat
Forum Members
Forum Members
Posts: 30
Joined: Mon Mar 07, 2011 1:02 pm

Re: 2.2.14 news title problem - special characters

Post by fowlerat »

Thanks Rolf. Has this fix been rolled into 2.2.14 or will the news module need updating after each upgrade? Regards.
User avatar
DIGI3
Dev Team Member
Dev Team Member
Posts: 1627
Joined: Wed Feb 25, 2009 4:25 am
Location: Victoria, BC

Re: 2.2.14 news title problem - special characters

Post 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.
Not getting the answer you need? CMSMS support options
fowlerat
Forum Members
Forum Members
Posts: 30
Joined: Mon Mar 07, 2011 1:02 pm

Re: 2.2.14 news title problem - special characters

Post 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?
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3483
Joined: Mon Nov 28, 2011 9:29 am
Location: The Netherlands

Re: 2.2.14 news title problem - special characters

Post 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.
howey
Forum Members
Forum Members
Posts: 158
Joined: Fri Sep 14, 2007 1:05 pm

Re: 2.2.14 news title problem - special characters

Post 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.
howey
Forum Members
Forum Members
Posts: 158
Joined: Fri Sep 14, 2007 1:05 pm

Re: 2.2.14 news title problem - special characters

Post 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&#37; With Combined Heat and Power &#40;CHP&#41; "
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
howey
Forum Members
Forum Members
Posts: 158
Joined: Fri Sep 14, 2007 1:05 pm

Re: 2.2.14 news title problem - special characters

Post 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
Post Reply

Return to “CMSMS Core”