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 »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • kcfinder not working due to 'page not found' error
Pages: [1]

Author Topic: kcfinder not working due to 'page not found' error  (Read 1437 times)

Eli Brasse

  • I’m new here
  • *
  • Posts: 2
  • Karma: 0
  • CiviCRM version: 4.2.8
  • CMS version: Drupal 7.32
  • MySQL version: 5.5.37-cll
  • PHP version: 5.4.32
kcfinder not working due to 'page not found' error
October 28, 2014, 05:12:35 pm
Hi there,

I have recently migrated CiviCRM to a new web host. This all went ok (more or less), but there is one problem left: I can't get kcfinder to work! I think I have configured it all correctly, and my file path is also correct. And yet, when I try to use kcfinder, I get the following result:

I am in 'Mailings' and clicking on the 'image' button. I can copy and paste an existing image url in and this works, but if I go to 'browse server', I get this:

Page not found

The requested page "/sites/all/modules/civicrm/packages/kcfinder/browse.php?cms=civicrm&type=images&CKEditor=html_message&CKEditorFuncNum=1&langCode=en" could not be found.

The location of the browse.php file seems correct to me, though. This is my setup: the drupal install with civicrm lives on a subdomain of my server (the public website on the main domain is a wordpress site). It is cleverly called .civi, so the file paths I have put in as resource urls are:

http://civi.example.org/sites/default/files/civicrm/persist/contribute/images/

The file path to the kcfinder files is:

http://civi.example.org/sites/all/modules/civicrm/packages/kcfinder/

This is my general config settings in kcfinder -

// GENERAL SETTINGS

    'disabled' => true,
    'uploadURL' => "upload",
    'uploadDir' => "",
    'theme' => "default",

    'types' => array(

    // (F)CKEditor types
        'files'   =>  "",
        'flash'   =>  "swf",
        'images'  =>  "*img",

    // TinyMCE types
        'file'    =>  "",
        'media'   =>  "swf flv avi mpg mpeg qt mov wmv asf rm",
        'image'   =>  "*img",
    ),


and this is my settings in creditor.php -

function toHtml()
    {
        if ($this->_flagFrozen) {
            return $this->getFrozenHtml();
        } else {
            $elementId = $this->getAttribute('id');
            $config = CRM_Core_Config::singleton( );
            $browseUrl = $config->userFrameworkResourceURL . 'packages/kcfinder/browse.php';
            $uploadUrl = $config->userFrameworkResourceURL . 'packages/kcfinder/upload.php';
 
            $html = parent::toHtml() . "<script type='text/javascript'>
                cj( function( ) {
                    cj('#{$elementId}').removeClass();
                    if ( CKEDITOR.instances['{$elementId}'] ) {
                        CKEDITOR.remove(CKEDITOR.instances['{$elementId}']);
                    }
                    if ( cj('#{$elementId}').val( ) == '' ) cj('#{$elementId}').val('&nbsp;');
                    CKEDITOR.replace( '{$elementId}' );
                    var editor = CKEDITOR.instances['{$elementId}'];
                    if ( editor ) {
                        editor.on( 'key', function( evt ){
                            global_formNavigate = false;
                        } );
                        editor.config.width              = '".$this->width."';
                        editor.config.height             = '".$this->height."';
                        editor.config.filebrowserBrowseUrl      = '".$browseUrl."?cms=civicrm&type=files';
                        editor.config.filebrowserImageBrowseUrl = '".$browseUrl."?cms=civicrm&type=images';
                        editor.config.filebrowserFlashBrowseUrl = '".$browseUrl."?cms=civicrm&type=flash';
                        editor.config.filebrowserUploadUrl      = '".$uploadUrl."?cms=civicrm&type=files';
                        editor.config.filebrowserImageUploadUrl = '".$uploadUrl."?cms=civicrm&type=images';
                        editor.config.filebrowserFlashUploadUrl = '".$uploadUrl."?cms=civicrm&type=flash';
                    }
                });
            </script>";
            return $html;
        }


As you can see, I think the problem is somewhere in the file paths. I have tried all sorts of fixes and read about the problems that other people have posted here, and I am at a loss!

Please help!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • kcfinder not working due to 'page not found' error

This forum was archived on 2017-11-26.