Wysiwyg is the first module I've installed in my D7 test environment. I'm using xampp and I installed wysiwyg just fine via the super duper "Install new module" functionality. :)

Once I copied the TinyMCE folder from my D6 site to my D7 site I received the following message:

Notice: Undefined offset: 0 in wysiwyg_profile_overview() (line 386 of C:\xampp\htdocs\drupal-7\sites\default\modules\wysiwyg\wysiwyg.admin.inc).

I went ahead and configured the module and the message continues to shows up at admin/config/content/wysiwyg.

But when I use the module in the content type "Blog" there are no errors.

Just FYI.

Comments

twod’s picture

I've seen this error reported before, I am unable to reproduce it when reinstalling D7 HEAD but I'll keep trying. The error is in the listing of the install instructions for each editor so it's not harmful.

spangaroo’s picture

Thank you for the reply TwoD. It doesn't seem to hurt my site at all, or even show up besides on the config page.

At first I thought it was because I copied the tinyMCE directory from D6 to D7, instead of downloading a fresh version from the website. Seems not to matter so much though.

twod’s picture

Yes the error will only show up on that page. Does the installation instructions fieldset at the bottom look odd in any way when opened? If the array the offset is for is empty you should be missing the library path in at least one of the examples (except for in rows of those editors you have installed, from which it is removed by design).

Which PHP version are you running?
You're running this on Windows and I'm on Ubuntu, might be a clue. Which Windows version are you using?

spangaroo’s picture

Installation instructions fieldset looks normal. I'm on Windows, PHP Version 5.2.9.

I found there is a slight issue with the Overlay. Don't think it has anything to do with the issue I originally posted, so if I should report it somewhere else, no problem. (Screenshots attached.)

twod’s picture

Component: Editor - TinyMCE » User interface
Status: Active » Needs review
StatusFileSize
new1.34 KB

Thank you for the 12-17-2009-scroll-installation.jpg image! The fieldset is actually incorrect on the CKeditor line, notice there is no filename in the path. Pure coincidence that I noticed it hehe.

Here's a patch that should take care of the notice and make the filename appear.

The Overlay issue was mentioned in the original overlay issue and happens with any collapsible fieldset so that needs to be fixed there.

sun’s picture

+++ wysiwyg.admin.inc	17 Dec 2009 22:32:55 -0000
@@ -381,9 +381,10 @@ function wysiwyg_profile_overview($form,
-        '@library-filepath' => $editor['library path'] . '/' . $editor['libraries'][$library]['files'][0],
+        '@library-filepath' => $editor['library path'] . '/' . (is_int($editor_files_first_key) ? $editor['libraries'][$library]['files'][0] : $editor_files_first_key),

I think that just checking for isset($editor['libraries'][$library]['files'][0]) should be sufficient here - all we want is to figure out whether we're dealing with an indexed array or not. And if not, a simple key($editor['libraries'][$library]['files']) should get us the first array key string.

This review is powered by Dreditor.

twod’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new1.18 KB

Ah of course! That should have been obvious...

Patch updated according to sun's review. It's now a trivial change, and it works on D6 and D7 (just a few lines offset). I don't have D5 to test with but as the code is also the same there I'm 100% sure it's ok.

I'm marking this RTBC, but not committing it just yet so sun has time to slap me across the fingers for RTBC:ing my own patch. ;)

sun’s picture

Great, thanks! Do you still know how to commit? :-D The code in 5.x should indeed look almost the same.

twod’s picture

Yeah I do, I'm a bit out of practice tho since I've had to postpone things for various reasons lately hehe. Will commit this when I get my other computer in order again. (Had a power outage last night at exactly the wrong time...)

twod’s picture

Status: Reviewed & tested by the community » Fixed

Committed to all branches.
Thanks for reporting, reviewing and testing. The code will be available in the -dev snapshots within a few hours.

Status: Fixed » Closed (fixed)

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