CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviMail (Moderator: Piotr Szotkowski) »
  • Where is the base URL for KCFinder set
Pages: [1]

Author Topic: Where is the base URL for KCFinder set  (Read 4328 times)

Martin Fuggle

  • I post frequently
  • ***
  • Posts: 172
  • Karma: 3
    • Travel and Photography
  • CiviCRM version: 4.2.x, 4.3.x, 4.4.x, 4.5.x
  • CMS version: Drupal 6.x and 7.x
  • MySQL version: 5.1.36-cll
  • PHP version: 5.3.6
Where is the base URL for KCFinder set
February 18, 2014, 10:04:45 pm
When I use CKEditor/KCFinder to insert images the path that is used is ~/sites/default/files/civicrm/images. Where is that set?

Cheers
Martin Fuggle

lucastiv

  • I’m new here
  • *
  • Posts: 2
  • Karma: 0
  • CiviCRM version: 4.4.3
  • CMS version: Drupal 7.24
  • MySQL version: 5.5.32
  • PHP version: 5.3.28
Re: Where is the base URL for KCFinder set
March 15, 2014, 07:48:52 am
Hi, I add my doubts to your post.

I noticed that the only option avaible is the "Image path" in the civicrm/admin/setting/path options.
In my case it was set at: sites/default/files/civicrm/persist/contribute/

Changing the option changes the place where CKedior and TinyMCE look for images when you select their "browse" option.

What really puzzles me is that both editors append a fixed subdir to the original path, and that subdir is different for each editor.

If i set the path to sites/default/files/pictures
- CKeditor will look for images in the sites/default/files/pictures/images folder
- TinyMCE will look for images in the sites/default/files/pictures/image folder

As a side note: i use civicrm/admin/setting/preferences/display to change the default editor.

Now... I am not able to find/understand a way to correct this behaviour (which is my humble opinion is wrong). Can anyone help finding th correct solution?

[EDIT: just noticed that the same behaviour applies to files to (TinyMCE uploads in "file" folder, CKeditor in "files" folder]
« Last Edit: March 15, 2014, 07:58:26 am by lucastiv »

lucastiv

  • I’m new here
  • *
  • Posts: 2
  • Karma: 0
  • CiviCRM version: 4.4.3
  • CMS version: Drupal 7.24
  • MySQL version: 5.5.32
  • PHP version: 5.3.28
Re: Where is the base URL for KCFinder set
March 19, 2014, 08:52:36 am
I think i found a partial solution. I changed the file:

  sites/all/modules/civicrm/packages/HTML/QuickForm/ckeditor.php

from line 77 on it configures the CKeditor sessions (as i understood, im very far from a programmer)

i changed the paths as they appear in this line and the following:

     editor.config.filebrowserBrowseUrl      = '".$browseUrl."?cms=civicrm&type=file';

Now CKeditor correctly uploads files in the "file" subdir instead of "files". I also made the file

   sites/all/modules/civicrm/packages/kcfinder/config.php

Consistent with the change and modified this (from line 55):

        // CKEditor & FCKEditor types
        'file'   =>  "",
        'flash'   =>  "swf",
        'image'  =>  "*img",


Now i'm not sure it is the correct solution, but at least the file paths in CKedit and TinyMCE are now consistent.

Tested on my install and file and image upload works as intended.

I got the idea from this post: https://forum.civicrm.org/index.php?topic=12091.0 which kindly locates:

  sites/all/modules/civicrm/packages/HTML/QuickForm/ckeditor.php

« Last Edit: March 19, 2014, 08:55:29 am by lucastiv »

Martin Fuggle

  • I post frequently
  • ***
  • Posts: 172
  • Karma: 3
    • Travel and Photography
  • CiviCRM version: 4.2.x, 4.3.x, 4.4.x, 4.5.x
  • CMS version: Drupal 6.x and 7.x
  • MySQL version: 5.1.36-cll
  • PHP version: 5.3.6
Re: Where is the base URL for KCFinder set
March 25, 2014, 02:38:34 am
I see the same behaviour which is clearly not sensible. But that's not my problem. When I use KCFinder to locate an image it looks in the defined image path/images (or image as the case maybe). I can upload an image and if I then select it into the text area I just see a red cross. The URL has been changed from image path/images to image path/civicrm/images.

I just don't understand why this is happening.

Martin Fuggle

Barnacle

  • I post occasionally
  • **
  • Posts: 62
  • Karma: 2
    • White Fuse Media
  • CiviCRM version: 4.4
  • CMS version: Drupal 7
  • MySQL version: 5.x
  • PHP version: 5.3
Re: Where is the base URL for KCFinder set
December 16, 2014, 04:37:43 am
Hi,

Did you ever find a solution to this? I'm getting the exact same problem. The "directories" image folder in CiviCRM is set to "sites/default/files/civicrm/persist/contribute/" but the KCFinder is still looking at "sites/default/files/civicrm/images/images/" and shows a broken image, even though it does upload the image successfully.
--
http://whitefusemedia.com/

Barnacle

  • I post occasionally
  • **
  • Posts: 62
  • Karma: 2
    • White Fuse Media
  • CiviCRM version: 4.4
  • CMS version: Drupal 7
  • MySQL version: 5.x
  • PHP version: 5.3
Re: Where is the base URL for KCFinder set
December 16, 2014, 04:43:44 am
Never mind - it turns out the KCFinder uses the "Resource URL" for images when displaying, even though it uses the "directories" for images when uploading. That is why they both have to be the same!
--
http://whitefusemedia.com/

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviMail (Moderator: Piotr Szotkowski) »
  • Where is the base URL for KCFinder set

This forum was archived on 2017-11-26.