Note: this bug happens while using i18n module.

Notice : Trying to get property of non-object dans locale_language_url_rewrite_url() (ligne 423 dans /var/www/includes/locale.inc).

This error is generated (twice) each time a form with a Wysiwyg-enabled field is displayed.

This is non-blocking, but fairly annoying for my customers.

Apparently this is caused when calling the url() function with a string parameter for the language ('en', 'fr',...), instead of a language object.

I think this could be easily fixed...

Comments

TarKHaoS’s picture

Actually, in kcfinder.inc.php, the kcfinder_library_path_url() [line 50] can be rewritten as following:

/**
* Returns the kcfinder library absolute url path, based on variable_get('kcfinder_library_path')
*/
function kcfinder_library_path_url() {
	return url(variable_get('kcfinder_library_path'), array('absolute' => TRUE));
}
torbasow’s picture

No, this line must be:

return url(variable_get('kcfinder_library_path'), array('absolute' => TRUE, 'language' => (object)array('language' => '')));

Because if you have multilingual site with prefixes and argument language is omitted here then default language prefix will be inserted and upload path will be broken. Default language setting must be prevented with that value so we’ll come here (locale.inc):

elseif (!isset($languages[$options['language']->language])) {
    unset($options['language']);
    return;
  }

Sorry for my bad English.

marcof-1’s picture

I confirm the issue and the solution proposed by torbasow.

TarKHaoS’s picture

I confirm that solution #2 works.

This would be great if this fix is applied in next release of the module.