When I add a module at admin/settings/mailsystem I receive the following PHP error:

warning: array_flip(): Can only flip STRING and INTEGER values! in [PATH]/sites/all/modules/mailsystem/mailsystem.admin.inc on line 142.

Comments

pillarsdotnet’s picture

Status: Active » Postponed (maintainer needs more info)

Grr!!! Thought I fixed this. How exactly did you manage to make this error re-appear?

pillarsdotnet’s picture

I can't reproduce this. Are you still experiencing this problem? If so, try clearing the mail_system variable.

From the command line
mysql DRUPALDATABASE -e 'delete from variable where name="mail_system"'
From a PHP-Filtered Drupal page
variable_del('mail_system');

A third option should be completely uninstalling Mail System but alas I hadn't anticipated the need and therefore haven't coded the mailsystem_uninstall() hook.

EDIT: Wrote the hook but didn't roll a new release just yet.

pillarsdotnet’s picture

Version: 6.x-1.10 » 6.x-1.11
Status: Postponed (maintainer needs more info) » Fixed

gonna call this one fixed in 6.x-1.11 unless somebody re-opens.

johnv’s picture

Version: 6.x-1.11 » 7.x-1.x-dev
Status: Fixed » Patch (to be ported)

Got the same error, on line 159 with version = "7.x-1.x-dev" fo 12-4-2011.
- install module for first time, add new setting, save.

johnv’s picture

@#2: a simpler way to delete the variable and reproduce the error:
- activate devel
- go to /devel/variable, or choose Variable editor from Admin menu.
- select the variable mail_system, go down, and press [delete]

pillarsdotnet’s picture

Status: Patch (to be ported) » Closed (won't fix)

7.x-1.x is no longer supported.

johnv’s picture

Status: Closed (won't fix) » Active

@#6: I don't understand: there are new D7-versions from 10 and 12 april, and this module is a prerequisite of D7-version of http://drupal.org/project/htmlmail

rsbecker’s picture

I'm getting this error with 6.x.1.11 every time I add a new module.

I have been using HTML Mail in debug mode to try and ID the modules and $keys. I have never received a $key value, so I leave the field blank. When I select a new module, i.e. messaging > messaging and click Save I get the error message:

warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in /var/www/html/drupal/sites/all/modules/mailsystem/mailsystem.admin.inc on line 142.

I then go to the new module and select HTMLMailSystem and click save and I get the error again. If I click save one more time it goes away.

The backtrace info follows:

Type	backtrace
Date	Tuesday, April 12, 2011 - 5:33pm
User	admin
Location	http://www.e-kehila.org/admin/settings/mailsystem
Referrer	http://www.e-kehila.org/admin/settings/mailsystem
Message	Type: php
array_flip() [<a href='function.array-flip'>function.array-flip</a>]: Can only flip STRING and INTEGER values! in /var/www/html/drupal/sites/all/modules/mailsystem/mailsystem.admin.inc on line 142.
Backtrace:
array_flip(a:1:{i:0;a:3:{s:14:"default-system";s:17:"DefaultMailSystem";s:9:"messaging";s:14:"HTMLMailSystem";s:5:"rules";N;}})[mailsystem.admin.inc:142];
.mailsystem_get_classes(a:1:{i:0;a:3:{s:14:"default-system";s:17:"DefaultMailSystem";s:9:"messaging";s:14:"HTMLMailSystem";s:5:"rules";N;}})[mailsystem.admin.inc:13];
..mailsystem_admin_settings(a:1:{i:0;a:3:{s:7:"storage";N;s:9:"submitted";b:0;s:4:"post";a:6:{s:10:"mailsystem";a:3:{s:14:"default-system";s:17:"DefaultMailSystem";s:9:"messaging";s:14:"HTMLMailSystem";s:5:"rules";s:14:"HTMLMailSystem";}s:10:"identifier";a:2:{s:6:"module";s:1:"0";s:3:"key";s:0:"";}s:2:"op";s:13:"Save settings";s:13:"form_build_id";s:37:"form-f5724858f85b39efa92845035b4ca79e";s:10:"form_token";s:32:"6c2eeac0e86e928aceedad00bb87d40d";s:7:"form_id";s:25:"mailsystem_admin_settings";}}})[?:?];
...call_user_func_array(a:2:{i:0;s:25:"mailsystem_admin_settings";i:1;a:1:{i:0;a:3:{s:7:"storage";N;s:9:"submitted";b:0;s:4:"post";a:6:{s:10:"mailsystem";a:3:{s:14:"default-system";s:17:"DefaultMailSystem";s:9:"messaging";s:14:"HTMLMailSystem";s:5:"rules";s:14:"HTMLMailSystem";}s:10:"identifier";a:2:{s:6:"module";s:1:"0";s:3:"key";s:0:"";}s:2:"op";s:13:"Save settings";s:13:"form_build_id";s:37:"form-f5724858f85b39efa92845035b4ca79e";s:10:"form_token";s:32:"6c2eeac0e86e928aceedad00bb87d40d";s:7:"form_id";s:25:"mailsystem_admin_settings";}}}})[form.inc:378];
....drupal_retrieve_form(a:2:{i:0;s:25:"mailsystem_admin_settings";i:1;a:3:{s:7:"storage";N;s:9:"submitted";b:0;s:4:"post";a:6:{s:10:"mailsystem";a:3:{s:14:"default-system";s:17:"DefaultMailSystem";s:9:"messaging";s:14:"HTMLMailSystem";s:5:"rules";s:14:"HTMLMailSystem";}s:10:"identifier";a:2:{s:6:"module";s:1:"0";s:3:"key";s:0:"";}s:2:"op";s:13:"Save settings";s:13:"form_build_id";s:37:"form-f5724858f85b39efa92845035b4ca79e";s:10:"form_token";s:32:"6c2eeac0e86e928aceedad00bb87d40d";s:7:"form_id";s:25:"mailsystem_admin_settings";}}})[?:?];
.....call_user_func_array(a:2:{i:0;s:20:"drupal_retrieve_form";i:1;a:2:{i:0;s:25:"mailsystem_admin_settings";i:1;a:3:{s:7:"storage";N;s:9:"submitted";b:0;s:4:"post";a:6:{s:10:"mailsystem";a:3:{s:14:"default-system";s:17:"DefaultMailSystem";s:9:"messaging";s:14:"HTMLMailSystem";s:5:"rules";s:14:"HTMLMailSystem";}s:10:"identifier";a:2:{s:6:"module";s:1:"0";s:3:"key";s:0:"";}s:2:"op";s:13:"Save settings";s:13:"form_build_id";s:37:"form-f5724858f85b39efa92845035b4ca79e";s:10:"form_token";s:32:"6c2eeac0e86e928aceedad00bb87d40d";s:7:"form_id";s:25:"mailsystem_admin_settings";}}}})[form.inc:104];
......drupal_get_form(a:1:{i:0;s:25:"mailsystem_admin_settings";})[?:?];
.......call_user_func_array(a:2:{i:0;s:15:"drupal_get_form";i:1;a:1:{i:0;s:25:"mailsystem_admin_settings";}})[menu.inc:348];
........menu_execute_active_handler(a:0:{})[index.php:18];
.........index.php
Severity	notice
Hostname	108.18.211.72
Operations	
pillarsdotnet’s picture

Status: Active » Needs work

Oops! sorry. The 1.x branch of htmlmail is no longer supported. Of course the 1.x branch of Mail System is.

Thanks for the informative backtrace. I see the problem -- the value for the 'rules' key is set to NULL, and NULL cannot be the key of an array.

Will roll a new release shortly.

pillarsdotnet’s picture

Status: Needs work » Fixed

Fixed by 7.x-1.12 release.

Thanks everyone once again for your patience. Your feedback is helping make this project better!

pillarsdotnet’s picture

Assigned: Unassigned » pillarsdotnet
rsbecker’s picture

Error message gone in 6.x

Status: Fixed » Closed (fixed)

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