CKeditor shows no custom styles

This is an open forum for any mojoPortal topics that don't fall into the other categories.

This thread is closed to new posts. You must sign in to post in the forums.
1/2/2010 5:06:54 AM
Gravatar
Total Posts 220

CKeditor shows no custom styles

Hi Joe,
I am in a quandary. TinyMCE and FCKeditor are not able to render € and CKeditor shows no custom styles in its select list.
Is it possible to solve one this problems?
Best
Matthias

1/2/2010 5:20:51 AM
Gravatar
Total Posts 18439

Re: CKeditor shows no custom styles

Hi Matthias,

It does work in CKeditor for me. If you downloaded mojoportal 2.3.3.2 right after it was released, you may try downloading and deploying it again. A few patches were applied to it in the days right after the initial release. On of the patches was related to CKeditor template/style integration.

So redeploying the files may fix it for you.

Alternatively, I'm thinking of putting out an interim build of the latest stable code so people can test the new File Manager improvements. If you would be interested in trying the new build let me know. It is also already deployed on demo.mojoportal.com so you can test the new file manager there as well.

Best,

Joe

1/2/2010 6:28:32 AM
Gravatar
Total Posts 220

Re: CKeditor shows no custom styles

Yes, I'm interested in trying the new build.

Best
Matthias

1/2/2010 6:31:43 AM
Gravatar
Total Posts 18439

Re: CKeditor shows no custom styles

I will post again later today when the build is available.

Best,

Joe

1/2/2010 2:06:08 PM
Gravatar
Total Posts 18439

Re: CKeditor shows no custom styles

I've uploaded the new build, see this thread for notes about it.

Best,

Joe

1/3/2010 6:35:49 AM
Gravatar
Total Posts 220

Re: CKeditor shows no custom styles

Hi Joe,

sorry, but I have the version 2.3.3.4 MySQL now, I add a new style, in tinyMCE it is in the select list but the list of the CKEditor is still empty.

Btw.: the browser shows a javascript errror when the editor is open ...
Message: identifier, string or number expected
Zeile: 1
Zeichen: 70
Code: 0
URI: http://localhost/mojoB/Services/CKeditorStyles.ashx?cb=b1ddea91-d302-4848-87d7-7bb2464b47be
Message: 'length' is null or no object
Zeile: 63
Zeichen: 1059
Code: 0
URI: http://localhost/mojoB/ClientScript/ckeditor302/ckeditor.js

Is it possible to load the former version of TinyMCE to solve my problem?

Best
Matthias

1/3/2010 7:12:38 AM
Gravatar
Total Posts 18439

Re: CKeditor shows no custom styles

Hi Matthias,

Can you produce the problem on demo.mojoportal.com?

I just tried it there and it worked for me. I created a style named highlight for element span and class highlight. I then select some text in the editor and click the styles dropdown and chose my style highlight and it wraps the text in a span with class="highlight" just as it should.

Note that it does work different in CKeditor than in TinyMCE, the options you see depend on what you have selected in the editor. For example if you define a style for img element it will only be available when you select an image in the editor.

Is it possible to load the former version of TinyMCE to solve my problem?

What do you mean? You can use TinyMCE if you don't like CKeditor and you can insert € from the toolbar in any of the editors.

Hope it helps,

Joe

1/3/2010 7:34:53 AM
Gravatar
Total Posts 220

Re: CKeditor shows no custom styles

Hi Joe,

maybe CKEditor don't like me.

When I go to http://demo.mojoportal.com and edit "Welcome" select some text in the editor and click the styles dropdown ... it is empty ;(

What can I do ?

Matthias

1/3/2010 7:41:42 AM
Gravatar
Total Posts 18439

Re: CKeditor shows no custom styles

Ok, I see, it is throwing a script error in IE 8. It works fine in Chrome or Firefox.

I will investigate and see if I can fix it in IE.

Best,

Joe

1/3/2010 9:08:45 AM
Gravatar
Total Posts 18439

Re: CKeditor shows no custom styles

I believe this is a bug in CKeditor, I've reported it in their issue tracker.

Best,

Joe

1/3/2010 9:38:15 AM
Gravatar
Total Posts 18439

Re: CKeditor shows no custom styles

Wow, the CKeditor guys already responded and told me how to solve it. Apparently the issue is that the word class is a keyword in javascript so when setting class attribute in json, it must be quoted. Other browsers must have more forgiving javascript engine. In any case, I got it weorking now with IE 8 on my machine, I will make another build package later today and let you know when it is ready.

Best,

Joe

1/3/2010 10:33:16 AM
Gravatar
Total Posts 220

Re: CKeditor shows no custom styles

by then: cheers
Matthias

1/3/2010 10:45:38 AM
Gravatar
Total Posts 18439

Re: CKeditor shows no custom styles

When I test using TinyMCE I can add the euro symbol to the content using the special character toolbar in IE 8, Firefox and Chrome. I even tried it with my culture setting forced to German and it still worked for me.

I just tried it also on demo.mojoportal.com and it also works there.

Are you using a custom config file for TinyMCE or are you using mojoTinyMCE.config?

Best,

Joe

1/3/2010 10:47:42 AM
Gravatar
Total Posts 18439

Re: CKeditor shows no custom styles

Oh, and many thanks for the beer!

Cheers,

Joe

1/3/2010 11:37:43 AM
Gravatar
Total Posts 220

Re: CKeditor shows no custom styles

Hi Joe,

I have no custom config file for TinyMCE and I haven't touched the mojoTinyMCE.config (I didn't even see it before :-)

Matthias

1/3/2010 12:00:27 PM
Gravatar
Total Posts 18439

Re: CKeditor shows no custom styles

I've uploaded a new build to the Novell Forge download page, mojoportal-mssql-deploymentfiles-20100103.zip

If you already got yesterday's build, I think the only files you need to get the fixes are mojoPortal.Web.dll and mojoPortal.Features.UI.dll

Best,

Joe

1/4/2010 5:55:49 AM
Gravatar
Total Posts 220

Re: CKeditor shows no custom styles

Hi Joe,

nice to see my favorite Website back online again :)

Now the style combo list in CKEditor is filled.
Thank you very much.

Is there a external styles definition file for the CKEditor to customize the presetting of the style combo list, or will this file be generated again, if I add a new style?



Maybe you are interested in a little test I made with TinyMCE.
These are the first 14 characters from the special character toolbar:
& " ¢ ? £ ¥ © ® T ? µ · . .
During the input all are displayed well, but after I saved it the 4th, 9th, 10th, 13th and 14th are wrong displayed.

Furthermore, when I take the symbol for "minutes/feet" from the special character toolbar and save, I get the "We're sorry but a server error has occurred ..." and in the System-Log you can read:
... MySql.Data.MySqlClient.MySqlException: You have an error in your SQL syntax; check the manual that corresponds to

your MySQL server version for the right syntax to use near '/p>' ...
The html of the last line was <p>&amp; " ¢ ? £ ¥ © ® T ? µ · . . '</p>

Unintended SQL injection ???

Best
Matthias

1/4/2010 6:37:17 AM
Gravatar
Total Posts 18439

Re: CKeditor shows no custom styles

Hi Matthias,

It does not generate a file, it uses a service url, the styles you define are stored in the db. As soon as you add a new one and go back into the editor it will appear.

That is strange that you would get a syntax error based on content because it is passed in as a parameter of type text, there is no string concatenation. Are you sure the table column you are saving to is configured for unicode?

If the table is not configured for unicode it will change unrecognized chars into ? in the db.

Best,

Joe

1/4/2010 9:09:20 AM
Gravatar
Total Posts 220

Re: CKeditor shows no custom styles

Hi Joe,

it uses a service url, the styles you define are stored in the db

that means, the custom styles are in the db and the default styles are "outsourced" as described in the developers guide on http://docs.cksource.com/?

Are you sure the table column you are saving to is configured for unicode?

I do not know, because I never touched the database myself and do also not know where mojo is saving the html content.
I go into a empty TinyMCE, choose the symbol for "minutes/feet" from the special character toolbar, push the save button beneath it and get back a MySql.Data.MySqlClient.MySqlException.

Best
Matthias
 


 

1/5/2010 1:58:15 PM
Gravatar
Total Posts 18439

Re: CKeditor shows no custom styles

Hi Matthias,

The mojoPortal service for populating the CKeditor styles dropdown is implemented to return a json result containing the styles defined in the mojoPortal style system formatted according to the ckeditor documentation about custom styles.

When you created your MySql database, you had to choose an encoding and collation (or else a server default was used) and this is used when creating all tables and columns. If you chose something other than unicode/utf-8 then it may have a problem storing certain characters and possibly could cause the error you describe. I will test it on a local copy of my own site soon and see if I can produce the error. Depending on what MySql management tools you use, you can also inspect the tables and columns and see what encoding/collations are specified and change them to utf-8/unicode unicode_general_ci if needed.

Best,

Joe

1/7/2010 8:56:01 AM
Gravatar
Total Posts 220

Re: CKeditor shows no custom styles

Hi Joe,

and I was digging around for a file (like ~\ClientScript\ckeditor302\plugins\stylescombo\styles\default.js) in which I can reduce the default list to a minimum ... :)

I created the database in Plesk with default settings. phpMyAdmin shows me the encoding UTF-8 Unicode (utf8) and the collation utf8_unicode_ci.

Best
Matthias

1/8/2010 6:44:46 AM
Gravatar
Total Posts 18439

Re: CKeditor shows no custom styles

Hi Matthias,

You should not modify any javascript files included with the editors. That file is not even used, that is the file that would be used if we were not overriding it to use our service url for styles.

If you want it to only use your custom styles you should add this to your user.config

<add key="AddSystemStyleTemplatesAboveSiteTemplates" value="false" />
<add key="AddSystemStyleTemplatesBelowSiteTemplates" value="false" />

for more info see Creating Content Style Templates.

Regarding the special characters errors, in my testing it works fine in MySql.

Does the problem occur in all features for you or only in specific content features?

Does using a different web browser make a difference?

Best,

Joe

1/8/2010 8:17:09 AM
Gravatar
Total Posts 220

Re: CKeditor shows no custom styles

Hi Joe,

Thank you that you have solved my error. I thought, these keys only regulate the order. I never thought about why there are two :).

I have tested the special charachter for "minutes / feet" that causes the exeption in tinyMCE in 5 different HTML content, and also with Chrome and Firefox

Best
Matthias

P.S: chrome and firefox ... look what they've done to my fonts, ma ...

1/8/2010 8:41:46 AM
Gravatar
Total Posts 220

Re: CKeditor shows no custom styles

To end this never-ending story I tested all special charachters in FCKEditor on another web server with an older version (2.3.1.9 MySQL) once more and it works. And tomorrow I will make an update, and if it still works correctly, then I suppose ... hmm ... I really don't know what, but perhaps you will know who is to blame.

Best
Matthias

1/9/2010 8:49:48 AM
Gravatar
Total Posts 220

Re: CKeditor shows no custom styles

Hi Joe,

two different servers, both with version 2.3.3.4.

On both TinyMCE and FCKEditor do not encode special characters and write € instead of &euro; or ′ instead of &prime; into the html.

On one server this works fine but the other displays "?" for € and throws a MySql.Data.MySqlClient.MySqlException with the ′
But when I load up a html file with both € and &euro; both were displayed correct.

Both MySQL servers have:

Server Version: 5.0.45-community-nt
Protokoll-Version: 10
Server: localhost via TCP/IP
MySQL-Zeichensatz: UTF-8 Unicode (utf8)
Zeichensatz / Kollation der MySQL-Verbindung: utf_unicode_ci
I tested both: utf_unicode_ci and utf_general_ci

On both servers the CKEditor encode and write &euro; or &prime; into the html. No problems.
I will continue using this one and forget the others ...

Best
Matthias

1/9/2010 9:17:59 AM
Gravatar
Total Posts 18439

Re: CKeditor shows no custom styles

Hi Matthias,

I suspect on the server where the error happens, there is something not correct in the charset and collation. I would inspect the charset and collation on the mp_HtmlContent table, specifically the column named "Body". It is possible that even if the table has the correct utf8/unicode setting that this column may have something different. I cannot produce the error with correct charset and encoding. 

Hope it helps,

Joe

1/10/2010 5:37:11 AM
Gravatar
Total Posts 220

Re: CKeditor shows no custom styles

Hi Joe,

here you can see the table ...

www.zisign.de

SELECT * FROM `mp_htmlcontent` LIMIT 0 , 30 : <p>? Maecenas lorem quam, nonummy et, sagittis non...

Have a good residual weekend ...

Matthias

1/10/2010 5:51:49 AM
Gravatar
Total Posts 18439

Re: CKeditor shows no custom styles

Hi Matthias,

Check your connection string, make it like this:

<add key="MySqlConnectionString" value="Server=yourserver;Database=yourdatabase;Uid=youruser;Pwd=yourpassword;Charset=utf8;" />

Note the important part at the end is Charset=utf8;

Do you have that part?

Hope it helps,

Joe

1/10/2010 8:01:08 AM
Gravatar
Total Posts 220

Re: CKeditor shows no custom styles

:)

Cheers
Matthias

1/10/2010 9:20:49 AM
Gravatar
Total Posts 18439

Re: CKeditor shows no custom styles

Glad that fixed it!

Many thanks for the beers!

Cheers,

Joe

You must sign in to post in the forums. This thread is closed to new posts.