Opened 9 years ago

Closed 8 years ago

#8893 closed Bug (fixed)

Error in documentation or bug in PasteFromWordCleanupFile option

Reported by: Michał Owned by: Piotrek Koszuliński
Priority: Normal Milestone: CKEditor 4.0.1
Component: Core : Pasting Version: 3.1
Keywords: HasTest Cc:

Description (last modified by Jakub Ś)

According to: http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html#.pasteFromWordCleanupFile it should works when I add

CKEDITOR.config.pasteFromWordCleanupFile = 'custom';

to config.js file, but it doesn't work. This works fine:

CKEDITOR.config.pasteFromWordCleanupFile = 'plugins/pastefromword/filter/custom.js';

Proposed fix to _source/plugins/pastefromword/plugin.js line 104 is change

var filterFilePath = CKEDITOR.getUrl( CKEDITOR.config.pasteFromWordCleanupFile || ( this.path + 'filter/default.js' ) );

to something like:

var filterFilePath = CKEDITOR.getUrl((this.path+CKEDITOR.config.pasteFromWordCleanupFile+'.js') || ( this.path + 'filter/default.js' ) );

or fix description in Documentation.

Attachments (2)

8893.patch (847 bytes) - added by Jakub Ś 9 years ago.
8893_1.patch (2.5 KB) - added by Jakub Ś 8 years ago.

Download all attachments as: .zip

Change History (19)

comment:1 Changed 9 years ago by Jakub Ś

Description: modified (diff)

comment:2 Changed 9 years ago by Jakub Ś

Status: newconfirmed
Version: 3.6.23.1

Reproducible from CKEditor 3.1.

comment:3 Changed 9 years ago by Jakub Ś

Owner: set to Jakub Ś
Status: confirmedassigned

Changed 9 years ago by Jakub Ś

Attachment: 8893.patch added

comment:4 Changed 9 years ago by Jakub Ś

Assuming documentation is right there is no default value assigned to CKEDITOR.config.pasteFromWordCleanupFile and described method of just specifying file name placed in “filter” folder will not work.

The below patch solves both of these issues.

Version 0, edited 9 years ago by Jakub Ś (next)

comment:5 Changed 9 years ago by Jakub Ś

Status: assignedreview

comment:6 Changed 9 years ago by Frederico Caldeira Knabben

Status: reviewreview_failed

The proposed patch is wrong as it makes it impossible to have the file outside the editor installation. I believe this is the main intention with the original implementation.

Btw, the pasteFromWordCleanupFile DOES have a default value, which is "<plugin folder>/filter/default.js".

The thing to be fixed here is the documentation. There are other possibilities, but better to just KISS.

Changed 8 years ago by Jakub Ś

Attachment: 8893_1.patch added

comment:7 Changed 8 years ago by Jakub Ś

Status: review_failedreview

There was still one error in code. Value from configuration option was never read.
I have fixed it plus updated docs. I’m putting it on review again.

NOTE I'm not only sure if default value should be <plugin path> + 'filter/default.js' or 'plugins/pastefromword/filter/default.js'

Last edited 8 years ago by Jakub Ś (previous) (diff)

comment:8 Changed 8 years ago by Jakub Ś

#9718 was marked as duplicate.

comment:9 Changed 8 years ago by Piotrek Koszuliński

Milestone: CKEditor 4.0.1
Status: reviewreview_failed

R-ed, because patch has to be ported to v4.

comment:10 Changed 8 years ago by Piotrek Koszuliński

Owner: changed from Jakub Ś to Piotrek Koszuliński
Status: review_failedassigned

comment:11 Changed 8 years ago by Piotrek Koszuliński

Status: assignedreview

Opened git:3a543ae plus tests for review.

comment:12 Changed 8 years ago by Piotrek Koszuliński

Keywords: HasTest added

comment:13 Changed 8 years ago by Olek Nowodziński

Status: reviewreview_failed

comment:14 Changed 8 years ago by Olek Nowodziński

Pastefromword requires a basic test for default filter configuration.

comment:15 Changed 8 years ago by Piotrek Koszuliński

Status: review_failedreview

Added basic test.

Force pushed both branches because of rebase.

comment:16 Changed 8 years ago by Olek Nowodziński

Status: reviewreview_passed

comment:17 Changed 8 years ago by Piotrek Koszuliński

Resolution: fixed
Status: review_passedclosed

Masterised git:894b1bc.

Note: See TracTickets for help on using tickets.
© 2003 – 2021 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy