The Linux Page

Updating your Drupal website from FCKeditor to CKEditor

As FCKeditor becomes old and the new CKEditor is started to get there, I'm updating more and more websites to make use of the newer version of CKEditor. This requires a few steps to make sure you don't lose the previous functionality.

Permissions

The update does not transfer the FCKeditor permissions to the CKEditor. This is because by the time you install the new CKEditor, the FCKeditor should already be uninstalled. In other words, those permissions are gone already. Plus, the scheme is slightly different in the new editor.

Roles

The list of roles who are assigned one CKEditor profile or another are also lost. These should be reassigned after the transfer so the editor shows as expected for the different users. It is best to make a list of roles per profile before switching.

Toolbar

The toolbars are not being copied properly. This is because the new editor uses a somewhat different scheme for its toolbar (i.e. the old one would use a name and the new one uses the actual JavaScript array.) To fix your database settings, you want to run the update.php code (which is not done automatically because you installed a new editor!) Go to your update.php page and click on Continue. Once you see the list of modules, search for ckeditor and select 6102. You are free to also run 6100 and 6101 but I do not see any code that's important in those 2 updates. There is the result you're expected to see:

The following queries were executed

ckeditor module
Update #6102
  • UPDATE PROFILE - Default
  • UPDATE PROFILE - Advanced

One problem of the new interface is that the new administration screen now doesn't give you a quick Copy & Paste way to transfer that information. Instead you have to drag and drop the different widgets you want to have in your toolbars.

Note that the CKEditor does not properly update the toolbar variables. This means you may actually need to do the work manually to get things to work right. The old version would make use of a bar name that referenced a set of buttons defined in JavaScript. The new editor uses the JavaScript description directly (no name). The new scheme is practical as it makes it very easy to change your toolbars and create new ones without having to edit that JavaScript code. Yet, it does not recognize the old designation and switch to their definitions.

Entities

In FCKeditor, I had to change a variable in the configuration file to get FCKeditor to NOT change characters other than ASCII in an entity.

In CKEditor, you can simple edit the Advanced Settings and select the mode with a simple click!

Mission / Footer not appearing?

When going to your Site information page, the Mission and Footer entries may not show up. I have absolutely no clue why that would happen, especially because it only happens on a few sites and the content is not even advanced content (i.e. just a paragraph of text!)

At this point, the only way I found to go around this bug is to remove the editor from those two entries. I have been wondering whether it would also be possible to NOT have them as simplified toolbars (I still don't see why it should be like that anyway?!) but tested with one of the sites that has the problem and it fails with the advanced toolbar too.

So... to fix this, go to your .../admin/settings/ckeditor/editg (CKEditor Global Profile in Administration » Site configuration » CKEditor) and add the following pattern to the Visibility settings:

admin/settings/site-information.*

And that way the editor is removed from those two entries and thus you can edit them with plain text (which accepts HTML as expected though.)

Stil Got Problems?

Somehow I had a site that showed some signs of "let's show a blank page" again. I then noticed that its CRON had not run for ages. Kicking that CRON manually fixed the blank page editor problem! I'm not too sure, but I would imagine that something in the cache was preventing the editor from working properly. So if you have problems, you should run .../cron.php and eventually clear all your caches and try again.