Collapsed Topic display issue

Collapsed Topic display issue

by Kevin Perkins -
Number of replies: 18

When Spanish teachers in our division are typing topic headings in Spanish, the characters are not displaying properly.  Any advice as to what code to tweak so these display properly?

Attachment collapsedtopics.png
Average of ratings: -
In reply to Kevin Perkins

Re: Collapsed Topic display issue

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

That looks like a character encoding issue. That is what you see when you have content that is encoded in utf-8 (which all Moodle is) and something treats it as ISO-.... whatever the number is.

In reply to Kevin Perkins

Re: Collapsed Topic display issue

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Dear Kevin,

It depends on the version of Collapsed Topics you are using - for 1.9 or 2.0+ ?

The area of code I suspect could be causing the issue is a call to 'html_to_text' in format.php - a standard Moodle function I believe (please correct me if I'm wrong Tim and if it has optional parameters for character encoding).  Try removing it... So 'html_to_text($thissection->name)' becomes '$thissection->name' if Moodle 2.0+ and 'html_to_text($thissection->summary)' to '$thissection->summary' if Moodle 1.9 and then kindly let me know if it works and for what version.

Cheers,

Gareth

In reply to Gareth J Barnard

Re: Collapsed Topic display issue

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

html_to_text is not a problem. It works fine with UTF-8

In reply to Tim Hunt

Re: Collapsed Topic display issue

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Thank you Tim smile

So, Kevin, do you have the issue when using standard topics format with the Topic Summary (Moodle 1.9) / Topic Name (Moodle 2.0+)?  If so then the issue is not Collapesed Topic's related but something else I think.

I notice that the TinyMCE editor has a 'lang' drop down combo box, does this make a difference?

Cheers,

Gareth

In reply to Gareth J Barnard

Re: Collapsed Topic display issue

by Kevin Perkins -

The issue is using topics format with the Topic Summary (Moodle 1.9).  I'm not familiar with the TinyMCE editor and how that could help troubleshoot this.

Kevin

In reply to Kevin Perkins

Re: Collapsed Topic display issue

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Dear Kevin,

It is the editor built into Moodle, please see attached on how to use the TinyMCE editor...

 I'm sorry, but your last message is not clear.  Is this a Collapsed Topic's only issue - i.e. does it appear fine in the standard topics format?  I need to test somehow, so would it be possible to post an example course or how to enter the spanish words that are causing the problem?

Cheers,

Gareth

Attachment ct_es.png
In reply to Gareth J Barnard

Re: Collapsed Topic display issue

by Kevin Perkins -

Sorry for the confusion.  The problem only appears using Collapsed Topics format. Spanish text appears normal in Standard Topics format. Even after adding the es language format you showed above, the text still does not display properly in Collapsed Topics format. To type the accent mark causing the problem on a Mac (the accented n) you type option n and then the letter n.  The text shows up fine in the Topic Summary but incorrect in the collapsed topic bar.

 

Attachment spanish text.png
In reply to Kevin Perkins

Re: Collapsed Topic display issue

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Dear Kevin,

No worries.

I have a PC so tried to replicate by using Alt-0241 (on the numeric keypad) for the 'n' with a tilde and could not as you can see from the attached.  I have a development version so just to be sure installed the current downloadable one from Moodle.org and noticed that yours has been customised as the shipped version has italic version of the summary.

What theme are you using?  The pic below is Standard White.  Do you get the issue with a standard Moodle theme such as that?  Or could it be that the font that is specified for the toggle title in the css is an all capitals one that does not have a 'ñ' in its character set?

I'm running Moodle 1.9.13 (Build: 20110817).

The language files I include with the format only affect the word 'Toggle' etc. and nothing else.

Cheers,

Gareth

Attachment ct_es_2.png
In reply to Kevin Perkins

Re: Collapsed Topic display issue

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Additionally, I find it strange that 'Final Exam' in your first example does not capitialise and yet 'Unidad 10: La Niñez' does get capitalised - I've just checked the full title too just in case.

In reply to Gareth J Barnard

Re: Collapsed Topic display issue

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Just had a brainwave and noticed that your title was in heading 3 format and bingo as attached but no transformation, but will keep looking...

Attachment ct_es_3.png
In reply to Gareth J Barnard

Re: Collapsed Topic display issue

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

In this example I've taken out the call to 'html_to_text' so the toggle looks odd but it appears that it is that function that is capitialising the text when called with a heading 3 (or indeed 1 or 2) html....

Attachment ct_es_4.png
In reply to Gareth J Barnard

Re: Collapsed Topic display issue

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

So Tim,

Please could I have some help with the 'html_to_text' function given the above.  I realise that the character set I'm using when the function capitalises the html is ok, but in Kevin's example, what can I do about it?

Thanks,

Gareth

In reply to Gareth J Barnard

Re: Collapsed Topic display issue

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Oh, I see. html_to_text tries to capitalise things, which if done in a stupid way, breaks UTF-8.

Aha, looking at the implementiation of that function, I see it has been fixed in recent versions. Looking through version control history, it seems it was fixed by someone called Tim Hunt: http://fisheye.moodle.org/changelog/Moodle?cs=36a40748e18b369e71c69960b329d531cd53663dMDL-25018. So, fixed between Moodle 1.9.10 and 1.9.11.

Average of ratings: Useful (1)
In reply to Tim Hunt

Re: Collapsed Topic display issue

by Kevin Perkins -

We're running an older version as you can see. We want to hold off upgrading to version 2 of Moodle until next academic year.  An upgrade to version 1.9.13 might very well solve this issue then?

Attachment Screen shot 2011-08-27 at 4.23.57 PM.png
In reply to Kevin Perkins

Re: Collapsed Topic display issue

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Dear Kevin,

Given what I have seen and tested, Tim has pointed out and fixed in core, then yes - as when I type the characters, put a heading and 'html_to_text' capitalises them, they are fine on Moodle 1.9.13 - latest stable I believe.

An upgrade from 1.9.5 to 1.9.13 should be straightforward.

Cheers,

Gareth

In reply to Kevin Perkins

Re: Collapsed Topic display issue

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

1.9.5 is ancient, and there have been many bugs fixed since then, including security bugs (http://moodle.org/security/). You should plan to upgrade to the latest release on whatever stable branch you are following from time to time.

In reply to Kevin Perkins

Re: Collapsed Topic display issue

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Kevin,

Have you been able to update to the latest 1.9 and solve your issue?

Cheers,

Gareth