Courses and course formats

Collapsed Topic display issue

 
Picture of Kevin Perkins
Collapsed Topic display issue
 

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?


 
Average of ratings: -
Tim at Lone Pine Koala Sanctuary
Re: Collapsed Topic display issue
Core developersDocumentation writersParticularly helpful MoodlersPlugin 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.

 
Average of ratings: -
Gareth J Barnard
Re: Collapsed Topic display issue
Core developersParticularly helpful MoodlersPlugin 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

 
Average of ratings: -
Tim at Lone Pine Koala Sanctuary
Re: Collapsed Topic display issue
Core developersDocumentation writersParticularly helpful MoodlersPlugin developers

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

 
Average of ratings: -
Gareth J Barnard
Re: Collapsed Topic display issue
Core developersParticularly helpful MoodlersPlugin 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

 
Average of ratings: -
Picture of Kevin Perkins
Re: Collapsed Topic display issue
 

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

 
Average of ratings: -
Gareth J Barnard
Re: Collapsed Topic display issue
Core developersParticularly helpful MoodlersPlugin 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


 
Average of ratings: -
Picture of Kevin Perkins
Re: Collapsed Topic display issue
 

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.

 


 
Average of ratings: -
Gareth J Barnard
Re: Collapsed Topic display issue
Core developersParticularly helpful MoodlersPlugin 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


 
Average of ratings: -
Gareth J Barnard
Re: Collapsed Topic display issue
Core developersParticularly helpful MoodlersPlugin 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.

 
Average of ratings: -
Gareth J Barnard
Re: Collapsed Topic display issue
Core developersParticularly helpful MoodlersPlugin 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...


 
Average of ratings: -
Gareth J Barnard
Re: Collapsed Topic display issue
Core developersParticularly helpful MoodlersPlugin 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....


 
Average of ratings: -
Gareth J Barnard
Re: Collapsed Topic display issue
Core developersParticularly helpful MoodlersPlugin 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

 
Average of ratings: -
Tim at Lone Pine Koala Sanctuary
Re: Collapsed Topic display issue
Core developersDocumentation writersParticularly helpful MoodlersPlugin 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)
Picture of Kevin Perkins
Re: Collapsed Topic display issue
 

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?


 
Average of ratings: -
Gareth J Barnard
Re: Collapsed Topic display issue
Core developersParticularly helpful MoodlersPlugin 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

 
Average of ratings: -
Tim at Lone Pine Koala Sanctuary
Re: Collapsed Topic display issue
Core developersDocumentation writersParticularly helpful MoodlersPlugin 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.

 
Average of ratings: -
Gareth J Barnard
Re: Collapsed Topic display issue
Core developersParticularly helpful MoodlersPlugin developers

Kevin,

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

Cheers,

Gareth

 
Average of ratings: -
Gareth J Barnard
Re: Collapsed Topic display issue
Core developersParticularly helpful MoodlersPlugin developers

Thank you so much Tim smile

 
Average of ratings: -