using the current dev module I'm getting some php notices:

notice: Undefined offset: 1 in /home/xxx/public_html/scratch/sites/all/modules/ckeditor/ckeditor.module on line 998.
Undefined index: simple_incl in /home/xxx/public_html/scratch/sites/all/modules/ckeditor/includes/ckeditor.admin.inc on line 1201.
Undefined index: excl in /home/xxx/public_html/scratch/sites/all/modules/ckeditor/includes/ckeditor.admin.inc on line 1201.

I took a look so I could submit a patch, but it seems beyond my miniscule php skills atm.

Comments

mephir’s picture

Hi. Can you write the relative url, where u got this notices, i cannot find them anywhere ...
If this page is generated by other module, can i please the name of module ?

WorldFallz’s picture

For the first one, watchdog says the referrer is admin/content/types, for the other 2 it's admin/build/modules.

wwalc’s picture

Do you perhaps remember what you were actually doing with the configuration of the CKEditor module?
Is it possible that you have remove the Global Profile, cloned profiles or something like that? I'm having troubles with reproducing it.
I'll try again tomorrow, but if you can give me some hints what were you doing (nothing special?) it could help me a bit. Thanks in advance!

WorldFallz’s picture

Nothing special at all-- the undefined index notices came as soon as i installed the module so I hadn't done anything yet. The undefined offset appears on the home page. One thing to note-- I'm using the dev version of d6 which shows all notices, maybe you're using the official release?

mephir’s picture

Have you got FCKEditor installed before on this Drupal installation?

wwalc’s picture

Hmm, could you try editing CKEditor profiles and resaving them (including Global Profile)?

WorldFallz’s picture

@mephir: nope, this was a fresh d6 dev install.

@wwalc: tried that also, still getting the undefined offset.

I can't get the undefined index notices to occur again though.

WorldFallz’s picture

ah... if i disable and uninstall the module, when I reenable it i get the undefined index notices-- 2 of each, for a total of 4 all on line 1201.

wwalc’s picture

Very strange.. I have just downloded 6.x-1.x-dev (2009-Dec-10), installed on a fresh Drupal 6.14 and can't reproduce it (I have also tried uninstalling & installing the module again).
Could you pelase try testing it on a vanilla Drupal installation with just the CKEditor 6.x-1.x-dev module enabled (please redownload the dev module, it has been updated today)?

WorldFallz’s picture

ok, i did that-- the undefined offset at 998 is now gone, but i still get the 4 undefined index errors when the module is first enabled. FYI my host is using 5.2.8.

WorldFallz’s picture

I have no clue why-- but I've discovered that the 'undefined offset on line 998' notice only appears when the devel module is present and enabled.

mephir’s picture

I enabled devel module and i couldn't confirmed this, anywhere.

WorldFallz’s picture

Yeah--- this is driving me insane. I have 2 versions of d6 dev installed in the same host-- they only differ by subdomain. On one I get the notice when devel is installed and enabled-- reliably. Turn off devel, the notice goes away. Turn it on, the notice comes back. I've probably done it n100 times.

On the other site I never get the offset notice (just the first 4 'undefined index' notices when the modules is first enabled, then nothing).

I'm absolutely at a loss-- this makes no technical sense whatsoever. Clearly, there has to be something different between the two sites but I can't figure out what it is. When i do, I'll post back.

wwalc’s picture

Can you PM me link to a dump of CKEditor tables (structure + content) in your database?

WorldFallz’s picture

StatusFileSize
new1.8 KB

Like this?

WorldFallz’s picture

another wierd piece of the puzzle... if I set a home page other than 'node' (ie 'node/1' or 'frontpage') the error also vanishes.

wwalc’s picture

@WorldFallz thanks for adding the database dump, I have fixed the problem with undefined index: simple_incl, excl in CVS. Upload the dev version of CKEditor module (should be available after midnight) and this problem should be gone (if it will not disappear instantly, re-save your CKEditor profiles).

I still cannot reproduce this error: notice: Undefined offset: 1 in /home/xxx/public_html/scratch/sites/all/modules/ckeditor/ckeditor.module on line 998.
On what page (url) exactly does this error appear (for example http://example.com/, http://example.com/node/1/edit, http://example.com/drupal/node/1/edit)?
(I don't have to know the exact domain name)

WorldFallz’s picture

The exact watchdog entry is:

Location	http://scratch.domain.com/
Referrer	http://scratch.domain.com/admin/build/modules
Message	Undefined offset: 1 in /home/x/public_html/scratch/sites/all/modules/ckeditor/ckeditor.module on line 998.

And it only happens if the default home page (admin/settings/site-information) is set to 'node' (the default).

WorldFallz’s picture

Actually-- i think I get why this notice occurs. It's because of the following line:

if ($get_q[0] == "node" && $get_q[1] == "add" && !empty($get_q[2])) {

On the default front page ('node') there is no $get_q[1] -- i have no idea why you don't receive the error or the best way to fix it, but this works:

if ($get_q[0] == "node" && !empty($get_q[1]) && $get_q[1] == "add" && !empty($get_q[2])) {
WorldFallz’s picture

Status: Active » Needs review
StatusFileSize
new685 bytes

And here's patch.

wwalc’s picture

Status: Needs review » Patch (to be ported)

Actually you're simply right, in such case there are no extra parameters in $_GET['q'] to find out what's the node type, so we can't do anything more than just checking it with empty() call, to get rid of that E_NOTICE error.

wwalc’s picture

Status: Patch (to be ported) » Fixed

Thanks, fixed in CVS.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.