Jeff VIP
Total posts: 745
17 Май 2013 08:39

Hi Sergey,

it took me a while to figure out what was causing the Timeline to be empty on my dev site.

It seems that when a record has a single quote in the Title and/or Description, nothing will be displayed in the Timeline. Not even other records which doesn't have a single quote in them.

Single quotes are very common in the English language:

O'Hara, I'm, that's, etc....

So I really need a solution for this.

BTW

Is there a reason why the Description field only accepts Text fields and not Text Area fields?

Best Regards,

Jeff

Последние изменения: 03 Янв 2021


Sergey
Total posts: 13,748
17 Май 2013 08:50

Fixed. Change line 18 of itimeline template from

$obj['headline'] = sprintf('%s%s', JRoute::_($item->url), ($item->nofollow ? 'rel=nofollow' : ''), $item->title, CEventsHelper::showNum('record', $item->id));

to

$obj['headline'] = sprintf('%s%s', JRoute::_($item->url), ($item->nofollow ? 'rel=nofollow' : ''), htmlentities($item->title, ENT_QUOTES, 'UTF-8'), CEventsHelper::showNum('record', $item->id));


Jeff VIP
Total posts: 745
17 Май 2013 09:39

Hi Sergey,

$obj['headline'] = sprintf('<a href=%s%s>%s%s</a>', JRoute::_($item->url), ($item->nofollow ? 'rel=nofollow' : ''), htmlentities($item->title, ENT_QUOTES, 'UTF-8'), CEventsHelper::showNum('record', $item->id)); 

Appending this code causes the single quote to be replaced by

&#039;

on the front end :S

Do you also have a fix for the Description text?

Best Regards,

Jeff


Jeff VIP
Total posts: 745
17 Май 2013 20:08

After reading this article: http://www.typographyforlawyers.com/?page_id=1322 I replaced the straight quotes into curly quotes with NoNumbers ReReplacer. That worked!

Modern word processors use Smart-quote sub­sti­tu­tion to convert straight quotes into curly ones, so copying and pasting text won't give you quote issues (they might produce a lot of other problems though). But when typing directly many - if not most - people use the single quote key, which is actually a straight quote key.

So Sergey, if you could adjust your code to replace straight quotes into curly quotes the darn thing would be solved (perhaps site wide?)

Best Regards,

Jeff


Sergey
Total posts: 13,748
20 Май 2013 00:11

Unfortunately I cannot. I will have to add str_replace to any JText input. That is a lot. I think this is should be fixed on the level of Joomla or in language INI file.


Jeff VIP
Total posts: 745
20 Май 2013 03:18

Ok, I understand.

Best Regards,

Jeff

Работает на Cobalt