While attempting to implement a custom set of predefined styles I am having trouble getting the configuration settings to function as specified in the documentation. Specifically, when I place a copy of ckeditor.styles.js in the active theme folder and set the option "Predefined styles" to "Use theme ckeditor.styles.js" it does not load my custom file and instead uses the file in the module.

Alternatively, if I set the "Predefined styles" to "Define path to ckeditor.styles.js" and use the provided text field to define the path, the listed tokens do not appear to function correctly. "%t" appears to lead to "/hostname/modules/field/" instead of to my theme. Also, it is a little confusing that some of the tokens appear to include the trailing slash, but not all of them. It would be good to make this consistent.

FYI, I am using a Zen based sub-theme and D7.0

Thanks,
Jason

CommentFileSizeAuthor
#6 fix_themepath-1039810-6.patch421 bytesanrikun

Comments

ccarigna’s picture

Version: 7.x-1.0 » 7.x-1.1
Status: Active » Needs review

The $themepath variable is using Drupal's path_to_theme() function, but that is returning the wrong value ("module/field"), and it can be unpredictable depending on where you call it from (see the first comment on http://api.drupal.org/api/drupal/includes--theme.inc/function/path_to_theme).

On line 479 in ckeditor.lib.inc, changing
$themepath = path_to_theme() . '/';

to
$themepath = drupal_get_path('theme', $theme) . '/';

will point to the proper path and load the custom ckeditor.styles.js file.

mkesicki’s picture

Thx @cwc for your solution. We will check this ASAP and fix this.

dczepierga’s picture

Status: Needs review » Fixed
Issue tags: +D7, +#d7ux, +ckeditor-7.x

@cwc really thx for patch, i commit it to GIT.

Please check the latest dev release and let me know if you notice any poblems with it. Remember to clear Drupal cache and browsers cache before testing.

Greetings

Status: Fixed » Closed (fixed)
Issue tags: -D7, -#d7ux, -ckeditor-7.x

Automatically closed -- issue fixed for 2 weeks with no activity.

anrikun’s picture

Version: 7.x-1.1 » 6.x-1.x-dev
Issue summary: View changes
Status: Closed (fixed) » Needs review
Issue tags: -D7, -#d7ux, -ckeditor-7.x
StatusFileSize
new421 bytes

This should be backported to D6.