Opened 15 years ago
Closed 14 years ago
#5446 closed Bug (fixed)
Setting config.filebrowserImageBrowseUrl results in displaying also Browser Server on links
Reported by: | Gerd W. Naschenweng | Owned by: | Tobiasz Cudnik |
---|---|---|---|
Priority: | Normal | Milestone: | CKEditor 3.4.2 |
Component: | General | Version: | |
Keywords: | Cc: |
Description (last modified by )
I am using the latest nightly build and when setting config.filebrowserImageBrowseUrl the "Browse Server" button is displayed on image-info. The "Browse Server" button is also displayed in the Link-tab.
This should not happen. I also specifically set config.filebrowserImageBrowseLinkUrl=''
hoping that this will remove the Browse Server on Link but this is not the case.
Attachments (4)
Change History (19)
comment:1 Changed 15 years ago by
Milestone: | → CKEditor 3.4 |
---|
comment:2 Changed 15 years ago by
Owner: | set to Tobiasz Cudnik |
---|---|
Status: | new → assigned |
comment:3 Changed 14 years ago by
Description: | modified (diff) |
---|---|
Milestone: | CKEditor 3.4 → CKEditor 3.5 |
Changed 14 years ago by
Attachment: | 5446.patch added |
---|
comment:4 Changed 14 years ago by
Status: | assigned → review |
---|
comment:5 Changed 14 years ago by
comment:6 Changed 14 years ago by
Yeah. Just tested this. I am confirming myself and asking for someone to test and approve my modification to tobiasz's patch because tobiasz's patch removes function original. tobiasz, the first part of your patch against _source/plugins/image/dialogs/image.js should be :
{ action : 'Browse', target: 'Link:txtUrl', url: ( undefined !== editor.config.filebrowserImageBrowseLinkUrl ) ? editor.config.filebrowserImageBrowseLinkUrl : editor.config.filebrowserBrowseUrl || editor.config.filebrowserImageBrowseUrl }, style : 'float:right', hidden : true,
The second part against _source/plugins/filebrowser/plugin.js :
if ( element.filebrowser.action == 'Browse' ) { var url = ( undefined !== element.filebrowser.url ) ? element.filebrowser.url : editor.config[ 'filebrowser' + ucFirst( dialogName ) + 'BrowseUrl' ] || editor.config.filebrowserBrowseUrl; if ( url )
Is fine.
comment:7 Changed 14 years ago by
Status: | review → review_failed |
---|
I'm with tony on this. We don't have to change the feature but simply have the undefined check.
Changed 14 years ago by
Attachment: | 5446_2.patch added |
---|
comment:8 Changed 14 years ago by
Status: | review_failed → review |
---|
Second patch fixes first one's property bug and includes Tony's proposition about filebrowser url inheritance (although in reversed priority order).
comment:9 Changed 14 years ago by
Having looked a bit deeper, here's what I think _should_ be happening instead :
If the user says that : editor.config.filebrowserImageBrowseLinkUrl === false No link button should appear. Same for if : editor.config.filebrowserSOME_PLUGIN_BrowseLinkUrl === false
If editor.config.filebrowserImageBrowseLinkUrl or editor.config.filebrowserSOME_PLUGIN_BrowseLinkUrl is undefined and not exactly false then the link button should show and open to editor.config.filebrowserBrowseUrl when clicked.
Also, for the second part of tobiasz's patch, the QuickUpload action isn't being patched like this too. Should it be? Thanks, Tony
comment:10 Changed 14 years ago by
Status: | review → review_failed |
---|
QuickUpload should also be patched. I also tend to agree with @tony.
Changed 14 years ago by
Attachment: | 5446_3.patch added |
---|
comment:11 Changed 14 years ago by
Status: | review_failed → review |
---|
This is how things work with latest patch, using Image dialog as example:
Image Info tab uses always:
config.filebrowserImageBrowseUrl
Link tab uses following:
config.filebrowserImageBrowseLinkUrl config.filebrowserImageBrowseUrl
If first one casts to false (we don't need the strict comparison), then Browse Server button is not visible. If it's undefined, used is the second one.
Fix for Quick Upload is now also included.
comment:12 Changed 14 years ago by
Status: | review → review_failed |
---|
Just to remind:
filebrowserBrowseUrl
enables all "Browse Server" buttons.filebrowserUploadUrl
enables all "Quick Upload" tabs.
Let's say that both configuration options are used to control the global filebrowser configuration.
What we really need to do here, is to guarantee that when such a global setting is present, user still must have a way to disable/modify each particular place where filebrowser is enabled (wherever possible - at the level of dialogs and/or where filebrowser.url is specified in the element).
The situation at this moment is that it is possible to modify each particular url assigned to the "Browse Server" button:
// make the url in the flash dialog different than filebrowserBrowseUrl filebrowserFlashBrowseUrl : 'flashbrowse.php'
however, it is impossible to disable this single button with something like:
// hide the "Browse Server" button in the Flash dialog - doesn't work at this moment filebrowserFlashBrowseUrl : false
Same applies to QuickUpload tabs.
We can change the target url in the Flash dialog with:
// make it different than filebrowserUploadUrl filebrowserFlashUploadUrl : 'flashupload.php'
but we cannot hide specific upload tab with:
filebrowserFlashUploadUrl : false
I'm setting it to review_failed mainly because the change included in the patch regarding QuickUpload part doesn't make too much sense to me and I believe we could have a more generic solution here, just like I explained above. Apart from adding support to disable "Browse Server" in the "Link" tab of the "Image" dialog with filebrowserImageBrowseLinkUrl
, we should be able to disable the "Browse Server" button and/or the Upload tab in selected dialog.
In other words, what we need to add is:
- if
editor.config[ 'filebrowser' + ucFirst( dialogName ) + 'BrowseUrl' ]
is defined and is set to false, buttons in this dialog should be hidden (...but stillconfig.filebrowserImageBrowseLinkUrl
could enable such button back in the Image dialog ifconfig.filebrowserImageBrowseUrl
was set to false) - if
editor.config[ 'filebrowser' + ucFirst( dialogName ) + 'UploadUrl' ]
is defined and set to false, the tab should be hidden in this dialog.
Changed 14 years ago by
Attachment: | 5446_4.patch added |
---|
comment:13 Changed 14 years ago by
Status: | review_failed → review |
---|
You're right Wiktor, the patch was missing second undefined check, so the inheritance chain is now as follows(for the Image dialog):
config.filebrowserImageBrowseLinkUrl config.filebrowserImageBrowseUrl config.filebrowserBrowseUrl
Inheritance is executed only for undefined values.
comment:14 Changed 14 years ago by
Status: | review → review_passed |
---|
comment:15 Changed 14 years ago by
Resolution: | → fixed |
---|---|
Status: | review_passed → closed |
Fixed with [5988].
Ahem; don't you mean :
Or even maybe :
tobiasz?
Seeing how you'd would generally want to link an image to a file instead of just an image of itself or an entirely different image. _most_ file browsers will default to showing all files using editor.config.filebrowserBrowseUrl and only images when editor.config.filebrowserImageBrowseUrl is accessed by the browser. At least that's the way my implementation works.
Otherwise the patch seems OK without having tested it.