Installation errors
Slim Pickens - October 9, 2008 - 03:12
| Project: | WYMeditor |
| Version: | 6.x-2.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
I was excited to find an update to the WYMeditor module but it still does not install correctly.
When trying to configure the WYMeditor format the following warning is generated:
warning: Invalid argument supplied for foreach() in /public_html/website.com/includes/form.inc on line 1181.
When creating new content the following warning is generated:
warning: Invalid argument supplied for foreach() in /public_html/website.com/modules/wymeditor/wymeditor.module on line 49.
The module seems to be working, but these messages are rather disconcerting.
Any ideas?

#1
After some investigations I found the problem for the first set of warnings.
[Tested with Drupal 6.5 and WYMeditor 6.x-2.x-dev (2008-10-09)]
On file wymeditor.module, lines :
I suppose problem occurs because of undefined data transmitted to form construction, for default_value parameter :
The $settings data is declared as an array in line 37.
Then data are affected to it on line 40, by values taken from wymeditor_profiles table (I am not absolutely sure of it because of my very small Drupal level as I am a young Drupal padawan !). But this table contains no default value.
So the problem is : not default profile values set on WYMeditor install !
And the second warning is a consequence of this first one.
I do not know this part of Drupal : so if anyone could help...
#2
I confirm diagnostic I previously made.
I filled the empty wymeditor_profiles table with data taken from another Drupal installation with WYMeditor on it (a previous not up to date WYMeditor version).
And warnings have gone !
For example purpose only here is the data on field settings I used for this test.
a:3:{s:3:"rid";i:1;s:6:"plugin";a:1:{s:7:"plugins";a:3:{s:8:"dropdown";i:0;s:10:"hovertools";i:0;s:4:"tidy";i:0;}}s:6:"button";a:2:{s:6:"enable";s:0:"";s:7:"buttons";a:17:{s:4:"bold";i:0;s:6:"italic";i:0;s:11:"superscript";i:0;s:9:"subscript";i:0;s:5:"olist";i:0;s:5:"ulist";i:0;s:6:"indent";i:0;s:7:"outdent";i:0;s:4:"undo";i:0;s:4:"redo";i:0;s:4:"link";i:0;s:6:"unlink";i:0;s:5:"image";i:0;s:5:"table";i:0;s:3:"pfw";i:0;s:4:"html";i:0;s:7:"preview";i:0;}}}I don"t understand the meaning of this code and then can correct this bug by myself. :-(
#3
I comfirm the error ...
warning: Invalid argument supplied for foreach() in /xxx/xxxx/xxxx/sites/all/modules/wymeditor/wymeditor.module on line 49.BUT, if I configure WYMeditor in "settings/filters/list", no more errors come out.
#4
Yes, I installed 6,8 + 6.x-2.x-dev (2008-Oct-09), same error.
That's the point: If one doesn't look into the install.txt in the modules dir; your drupal site won't tell you what to do. Next to that I don't have a "settings" under "administer"; I have many "settings" oversights, but none directly under "administer". For example: "Site configuration" but no "WYMeditor" there. But there is:
Administer › Site configuration > Input formats: "set default format"
WYMeditor All roles may use default format configure
> configure=> "warning: Invalid argument supplied for foreach() in .../includes/form.inc on line 1193."
WYMeditor profiles > checked everything for my userrole => "save configuration"
YES: On "add comment", WYMeditor shows up in all her beauty..!
There was another message that I apperently do not need, but others might: "Every filter performs one particular change on the user input, for example stripping out malicious HTML or making URLs clickable. Choose which filters you want to apply to text in this input format. If you notice some filters are causing conflicts in the output, you can rearrange them." (for me only html filter was checked by default)
Then I have many editors installed, but the others don't show up automatically on "add comment", nor Drupal seems to have a menu how to differentiate between all of them; one probably has to go to each editors individual menu: BUEditor, TinyMCE, FCKeditor, & others I might not have even checked-on. I provide this info as a reminder for users and programmers; install errors also could come forward from conflicts in these.
#5
Same problem, same fix -- enable filters and the line 40 errors go away.
Agree the directions in INSTALL.txt should be followed, but it would be more user friendly to have rational defaults.