#9779 closed Bug (fixed)
CKEditor 4 unable to override GetUrl
| Reported by: | Michael | Owned by: | |
|---|---|---|---|
| Priority: | Normal | Milestone: | CKEditor 4.0.2 |
| Component: | General | Version: | 4.0 |
| Keywords: | Cc: |
Description (last modified by )
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 (8)
comment:1 Changed 13 years ago by
| Status: | new → confirmed |
|---|
comment:2 Changed 13 years ago by
I am using CKEditor 4.0 and am also running into this problem. Do you know when it might be fixed?
comment:3 Changed 13 years ago by
I am also interested in upgrading to v4, but this feature is required to do so.
comment:5 Changed 13 years ago by
| 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 13 years ago by
| Description: | modified (diff) |
|---|
comment:7 Changed 13 years ago by
| Resolution: | → fixed |
|---|---|
| Status: | confirmed → closed |
Fixed with git:6e60de2. Thanks mharris!

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.urlEither there is some different approach used and not described in docs or an error in code.