Problems, need help? Have a tip or advice? Post it here.
8 posts Page 1 of 1
Hi all,

Kcfinder is acting weird, it's not displaying the right lay-out and pictures are not displayed. See screenshot.

If it helps; this is in the console (chrome) when i load the page:
Code: Select all
 Resource interpreted as Script but transferred with MIME type text/html: "http://xxxx.xx/couch/includes/ckeditor/ckeditor_v363b.php?t=C3HA5RM".
browse.php:7 Resource interpreted as Stylesheet but transferred with MIME type text/html: "http://xxxx.xx/couch/includes/kcfinder/css.php?type=image".
browse.php:14 Resource interpreted as Script but transferred with MIME type text/html: "http://xxxx.xx/couch/includes/kcfinder/js_localize.php?lng=en".


I've tried to reinstall Kcfinder, but no luck. Anybody has an idea?

Attachments

Hi,

KCFinder requires Couch 1.4 (or higher) to work.
From the console messages you posted, it seems you are using an older version of Couch (ckeditor_v363b.php is no longer used with the later versions)
Resource interpreted as Script but transferred with MIME type text/html: "http://xxxx.xx/couch/includes/ckeditor/ckeditor_v363b.php?t=C3HA5RM".

Please upgrade Couch and let us know if that solves the problem.

Thanks
Hi KK,

Thanks for your quick feedback.
I am using v1.4 (build 20140117) already, and the issue with kcfinder started about a week ago, before that is was fine.
In that case, I'll need to take a look at the problem first-hand to know anything about it.
PM me Couch+FTP access to your site, if you wish me to to do so.
Allright, please check your inbox.
Thanks for entrusting me with the access creds.

I logged-in and had a look.
The problem appeared to be that the CSS file highlighted below) used by KCFinder was, for some reason, being ignored by the browser
<link href="css.php?type=image" rel="stylesheet" type="text/css" />

It *was* being fetched but was treated as 'text/html' instead of 'text/css'.

Some minutes of head-scratching revealed that the CSS being received had some newline characters at its beginning which were unexpected. These were causing the browsers to reject it as a valid CSS resource.

This was akin to the well-known 'Cannot modify header information - headers already sent' problem - viewtopic.php?f=4&t=53) but the reason this time was not the BOM.

It was the kfunctions.php file in your site's root.
The file was ending like this -
Code: Select all
      return $html;
   }


?>




As you can see, it had the closing '?>' marker and there are newlines after that.
This is precisely why it is a bad practice to use '?>' end-marker in PHP files (please see the sample kfunctions file in docs - it does not have one).

Anyway, I removed the '?>' and the trailing newlines to make the kfunctions file now end simply like this -
Code: Select all
      return $html;
   }

And that solved the problem.
Please check and confirm.

Thanks.
It's working again!

Thank you for your explanation, i guess the ?> happend in the hurry when i was trying something in kfunctions.php.

I really appreciate your dedication KK. This is the 5th time I am making a website with Couch CMS and it's really easy to work with.
You are welcome, Azuil :)
8 posts Page 1 of 1