TinyPortal

Development => Feedback => Bugs/Errors => Topic started by: Jerri Blank on September 10, 2006, 03:51:18 PM

Title: "&undefined;" errors in HTML articles
Post by: Jerri Blank on September 10, 2006, 03:51:18 PM
I have an HTML article I created under 0.8.6, but under 0.9.5, all the apostrophes have been replaced with "&undefined;" .  Am I now going to have to escape apostrophes like you do in PHP code?

UPDATE: Escaping the apostrophes doesn't work.  Suggestions?

Thanks,

jb
Title: Re: "&undefined;" errors in HTML articles
Post by: IchBin on September 10, 2006, 04:36:12 PM
I can't remember what the work around for that is. But you can turn the editor off I think and that might work.
Title: Re: "&undefined;" errors in HTML articles
Post by: Jerri Blank on September 10, 2006, 05:38:47 PM
Thanks.  Do you know how to turn the editor off?



jb
Title: Re: "&undefined;" errors in HTML articles
Post by: IchBin on September 10, 2006, 05:44:16 PM
TinyPortal settings.
Title: Re: "&undefined;" errors in HTML articles
Post by: Jerri Blank on September 10, 2006, 06:06:15 PM
Thanks. :)



jb
Title: Re: "&undefined;" errors in HTML articles
Post by: WhispyTuft on September 20, 2006, 03:27:37 PM
Not sure if this will work for you, but here goes ...

/Themes/default/TPortalAdmin.template.php find:

// tinyMCE
if($context['TPortal']['use_wysiwyg']=='1' && $mg['useintro']!=-1){
echo '
<script language="javascript" type="text/javascript">
tinyMCE.init({
mode : "exact",
entity_encoding : "raw",
language : "en",
elements : "tp_article_body'.$mg['id'].'",
theme : "advanced",
plugins : "table,advhr,advlink,emotions,insertdatetime,preview,zoom,flash,searchreplace,contextmenu,ibrowser",
theme_advanced_buttons1_add : "fontselect,fontsizeselect",
theme_advanced_buttons2_add : "separator,insertdate,inserttime,preview,zoom,separator,forecolor,backcolor",
theme_advanced_buttons2_add_before: "cut,copy,paste,separator,search,replace,separator",
theme_advanced_buttons3_add_before : "tablecontrols,separator",
theme_advanced_buttons3_add : "emotions,flash,advhr,separator,print,ibrowser",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_path_location : "bottom",
convert_urls : false,
relative_urls : false,
plugin_insertdate_dateFormat : "%Y-%m-%d",
extended_valid_elements : "a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]"
});
</script>';
}



Replace with:

// tinyMCE
if($context['TPortal']['use_wysiwyg']=='1' && $mg['useintro']!=-1){
echo '
<script language="javascript" type="text/javascript">
tinyMCE.init({
mode : "exact",
elements : "tp_article_body'.$mg['id'].'",
theme : "advanced",
plugins :  "table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,zoom,flash,searchreplace,print,contextmenu",
theme_advanced_buttons1_add : "fontselect,fontsizeselect",
theme_advanced_buttons2_add : "separator,insertdate,inserttime,preview,zoom,separator,forecolor,backcolor",
theme_advanced_buttons2_add_before: "cut,copy,paste,separator,search,replace,separator",
theme_advanced_buttons3_add_before : "tablecontrols,separator",
theme_advanced_buttons3_add : "emotions,iespell,flash,advhr,separator,print",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_path_location : "bottom",
plugin_insertdate_dateFormat : "%Y-%m-%d",
extended_valid_elements : "a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]"
});
</script>';
}



The only things removed were:

entity_encoding : "raw",
language : "en",
convert_urls : false,
relative_urls : false,



This may not be right or proper, I am not sure. On the other hand, removing these has made it so that the apostrophes are actually apostrophes instead of &undefined; . To get the apostrophe to work, it may not require removing all four of these settings, but these are the ones I removed.

If any of this is wrong or could pose a security risk, please don't hesitate to inform me :)
Title: Re: "&undefined;" errors in HTML articles
Post by: Jerri Blank on September 20, 2006, 03:44:54 PM
Thanks.  Using a different wysiwyg editor actually took care of the problem, but I'm sure your solution would work as well.  I think this is a bug, because it didn't start happening until TP was update recently.
Title: Re: "&undefined;" errors in HTML articles
Post by: reddogfantoo on September 28, 2006, 04:10:51 AM
Quote from: WhispyTuft on September 20, 2006, 03:27:37 PM
The only things removed were:

entity_encoding : "raw",
language : "en",
convert_urls : false,
relative_urls : false,


I was able to get the same result by only removing the following:


entity_encoding : "raw",

Title: Re: "&undefined;" errors in HTML articles
Post by: djpushplay on October 24, 2006, 11:10:12 PM
Quote from: Jerri Blank on September 10, 2006, 03:51:18 PM
I have an HTML article I created under 0.8.6, but under 0.9.5, all the apostrophes have been replaced with "&undefined;" .  Am I now going to have to escape apostrophes like you do in PHP code?

UPDATE: Escaping the apostrophes doesn't work.  Suggestions?

Thanks,

jb

Just wanted to confirm that TP 0.9.6 still has this same problem. I removed the TinyMCE entity_encoding : "raw", as per a later post and that did the trick but not sure if this is the proper way. Does this have something to do with the UTF8 or ?

I also noticed 2 more places in "TPdladmin.template.php" where TinyMCE uses "raw" encoding. Not sure if those have to be removed as well.