Needs review
Project:
KCFinder integration
Version:
7.x-1.85
Component:
Code
Priority:
Minor
Category:
Bug report
Assigned:
Reporter:
Created:
19 Jul 2011 at 22:25 UTC
Updated:
22 Sep 2011 at 22:43 UTC
Jump to comment: Most recent file
When using KCFinder on a multilingual site with clean URLs enabled I get a 404 error when I try to open it from CKEditor.
After some digging, I realized that the path to the KCFinder files generated by the funtion kcfinder_pathfind is wrong. The url function adds a language prefix to the path, thus the 404 error. For example, when my current language is German, the generated path is /de/sites/all/modules/kcfinder/kcfinder_files/ instead of /sites/all/modules/kcfinder/kcfinder_files/.
The attached patch solved the problem for me
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | multilingual-404-error-1223868-1.patch | 751 bytes | setvik |
| multilingual-404-error.patch | 713 bytes | elias-schegg |
Comments
Comment #1
setvik commentedWorks for me.
Rerolling to apply from module directory (ala: http://drupal.org/node/1141686/git-instructions/7.x-1.x)
Comment #2
danyalejandro commentedThanks a lot! commited. Will activate the new release as soon as the KCFinfer project releases it's next version (it will come as a separate download)
Comment #3
muzius commentedthis patch did solve the problem but now drupal complains:
Notice: Trying to get property of non-object a locale_language_url_rewrite_url()
The problem arises when another module uses url() function specifying the language as a string "es" or "fr" for example, instead of a language object. Found the source of the problem in line 51 of kcfinder.inc.php, to get rid of this message either use the default language (which should have no prefix):
return url(variable_get('kcfinder_library_path'), array('absolute' => TRUE,'language' => language_default() ));
or provide a fake language module without prefix (maybe the safer solution):
return url(variable_get('kcfinder_library_path'), array('absolute' => TRUE,'language' => (object) array('language' => 'none', 'name' => 'none', 'prefix' => '') ));
thanks for your work on the kcfinder-integration, very much appreciated!
Comment #4
danyalejandro commented