Log in or register to post comments
Last post
gazillion's picture
Joined: 30/11/2009
Posts: 27
[imagereize plugin] api.lang is undefined
So I upgraded from 1.4.3 to 2.0 using your upgrading guide and things went well. I upgraded because I wanted to use the image resizing plugin but while following the installation steps it crashed the whole thing. I get the error mentioned in the title:

Error: api.lang is undefined
Source File: {snipsnip}l/includes/ckfinder/plugins/imageresize/plugin.js?t=A519
Line: 593


I can't find any information on this. I tried to setup all languages as "en" but even that didn't help.

Thanks for any help!
wiktor's picture
Joined: 16/07/2007
Posts: 1647
Re: [imagereize plugin] api.lang is undefined
I've tried reproducing it, but it works for me. A couple of questions:
- do you have this problem on our demo web site?
- what server side version of CKFinder are you using?
- what browser are you using?
- in what language CKFinder was running (apart from English) when this error occurred?

This issue looks really strange, please make sure that files you were working on are not corrupted (e.g. redownload CKFinder), clear browser's cache and try again.

Wiktor Walc
CTO, CKSource - http://cksource.com
--
Follow CKEditor on: Twitter | Facebook | Google+

gazillion's picture
Joined: 30/11/2009
Posts: 27
Re: [imagereize plugin] api.lang is undefined
Hi, thanks for the reply!


  • I do not have the problem on your demo site.

  • I am using the latest version of CKFinder from your website (the php version).

  • I am using FF 3.6.4

  • CKEditor and CKFinder are both running on their default language (I'm guessing English).


I tried following your instructions and cleared my cache and I re-downloaded the package and reinstalled it. It works great without the plugin, it's just when I include the imageresize that it breaks.

Here's how I add the plugin (maybe I'm doing it wrong hehehe)

CKFinder.customConfig = function( config )
{
   // Define changes to default configuration here. For example:
   // config.skin = 'v1';
   // config.language = 'fr';
   config.extraPlugins = 'imageresize';
};
wiktor's picture
Joined: 16/07/2007
Posts: 1647
Re: [imagereize plugin] api.lang is undefined
The right way of enabling it is to enable it in the server side configuration file (not in config.js):

include_once "plugins/imageresize/plugin.php";

Wiktor Walc
CTO, CKSource - http://cksource.com
--
Follow CKEditor on: Twitter | Facebook | Google+

gazillion's picture
Joined: 30/11/2009
Posts: 27
Re: [imagereize plugin] api.lang is undefined
That line is included automatically in the config.php, do I have to include it somewhere else as well? I know config.php gets called because it knows when our users are logged on and goes to the correct image folders :)
wiktor's picture
Joined: 16/07/2007
Posts: 1647
Re: [imagereize plugin] api.lang is undefined
Could you leave that include_once statement, but remove this from config.js:
 config.extraPlugins = 'imageresize';
?

This plugin should be enabled by CKFinder automatically, once it receives a response from a server that it really should be loaded. When you add it in config.js, then I suppose it is executed too early and that might be the source of a problem.

Wiktor Walc
CTO, CKSource - http://cksource.com
--
Follow CKEditor on: Twitter | Facebook | Google+

gazillion's picture
Joined: 30/11/2009
Posts: 27
Re: [imagereize plugin] api.lang is undefined
Well you just hit the nail on the head. I was used to working the same way CKEditor works and by removing that line from the config.js file it started working.

Thanks for the help