Opened 12 years ago

Last modified 12 years ago

#9779 closed Bug

CKEditor 4 unable to override GetUrl — at Version 6

Reported by: Michael Owned by:
Priority: Normal Milestone: CKEditor 4.0.2
Component: General Version: 4.0
Keywords: Cc:

Description (last modified by Frederico Caldeira Knabben)

In previous version you could override geturl by creating a function called CKEDITOR_GETURL. This seems be broken because of this block in ckeditor_base.js:

// Make it possible to override the "url" function with a custom
// implementation pointing to a global named CKEDITOR_GETURL.
var newGetUrl = window.CKEDITOR_GETURL;
if ( newGetUrl ) {
	var originalGetUrl = CKEDITOR.url;
	CKEDITOR.url = function( resource ) {
		return newGetUrl.call( CKEDITOR, resource ) || originalGetUrl.call( CKEDITOR, resource );
	};
}

It should be:

// Make it possible to override the "url" function with a custom
// implementation pointing to a global named CKEDITOR_GETURL.
var newGetUrl = window.CKEDITOR_GETURL;
if ( newGetUrl ) {
	var originalGetUrl = CKEDITOR.getUrl;
	CKEDITOR.getUrl = function( resource ) {
		return newGetUrl.call( CKEDITOR, resource ) || originalGetUrl.call( CKEDITOR, resource );
	};
}

Change History (6)

comment:1 Changed 12 years ago by Jakub Ś

Status: newconfirmed

Api and docs say about getUrl (E.g. http://docs.cksource.com/CKEditor_3.x/Developers_Guide/Editor_Core_URLs_Manipulation) while code for CKEditor v4 contains CKEDITOR.url

Either there is some different approach used and not described in docs or an error in code.

comment:2 Changed 12 years ago by Bill DePhillips

I am using CKEditor 4.0 and am also running into this problem. Do you know when it might be fixed?

comment:3 Changed 12 years ago by oiha

I am also interested in upgrading to v4, but this feature is required to do so.

comment:4 Changed 12 years ago by oiha

It would be nice to see a milestone. :)

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

Milestone: CKEditor 4.0.2

Here you are ;)

I haven't checked it yet, so I'm not sure if it's a regression or just a change that requires different approach when overwriting. I'll check this in a first place.

comment:6 Changed 12 years ago by Frederico Caldeira Knabben

Description: modified (diff)
Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy