CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Installing CiviCRM »
  • Drupal Installations (Moderator: Piotr Szotkowski) »
  • *** Solved *** Global Settings SMTP sends email but won't save settings
Pages: [1]

Author Topic: *** Solved *** Global Settings SMTP sends email but won't save settings  (Read 3278 times)

mhoerr

  • Guest
*** Solved *** Global Settings SMTP sends email but won't save settings
March 20, 2010, 04:17:08 pm
I'm configuring SMTP in Global Settings.

When I enter the settings and click "test and save" the email goes through perfectly.
But the settings aren't saved on the Settings - Outbound Mail page, and I get the following error:

warning: array_key_exists() [function.array-key-exists]: The second argument should be either an array or an object in /home/stambros/public_html/drupal/sites/all/modules/civicrm/CRM/Core/BAO/Setting.php on line 128.
« Last Edit: April 18, 2010, 09:12:28 pm by mhoerr »

Piotr Szotkowski

  • Moderator
  • I live on this forum
  • *****
  • Posts: 1497
  • Karma: 57
Re: Global Settings SMTP sends email but won't save settings
March 21, 2010, 06:01:12 am
Quote from: mhoerr on March 20, 2010, 04:17:08 pm
I'm configuring SMTP in Global Settings.

When I enter the settings and click "test and save" the email goes through perfectly.
But the settings aren't saved on the Settings - Outbound Mail page, and I get the following error:

warning: array_key_exists() [function.array-key-exists]: The second argument should be either an array or an object in /home/stambros/public_html/drupal/sites/all/modules/civicrm/CRM/Core/BAO/Setting.php on line 128.


What CiviCRM version are you using? Neither 3.1 nor 2.2 (which your forum profile advertises…) seem to have anything relevant in CRM/Core/BAO/Setting.php’s line 128…
If you found the above helpful, please consider helping us in return – you can even steer CiviCRM’s future and help us extend CiviCRM in ways useful to you.

mhoerr

  • Guest
Re: Global Settings SMTP sends email but won't save settings
March 27, 2010, 09:38:35 am
I work with more than one CiviCRM installation. The one I'm having trouble with now is version 3.0.3., Drupal 6.15.
I've changed my forum profile to reflect that.
« Last Edit: March 27, 2010, 09:47:19 am by mhoerr »

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Global Settings SMTP sends email but won't save settings
March 27, 2010, 03:59:34 pm

your best bet might be to upgrade to 3.1.3

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

mhoerr

  • Guest
Re: Global Settings SMTP sends email but won't save settings
April 18, 2010, 09:10:34 pm
OK, here's what happened.

The error was occurring in the formatParams(&$params, &$values) function of CRM/core/BAO/setting.php. The function was getting the new settings passed in correctly, but wasn't getting the existing data from the database.

Since I was getting the error when I clicked Save on the civicrm/admin/setting/smtp page, I looked up the code on CRM/Admin/Form/Setting/Smtp.php. Reading through that, I found that the postprocess function calls the formatParams() function if it finds a value for mailing_backend when it instantiates a new CRM_Core_DAO_Preferences object.

So I went to CRM/Core/DAO/Preferences.php to find out what that object was. I found out that it accesses the civicrm_preferences table. So now I knew where it was trying to get the information from: the mailing_backend field of the civicrm_preferences table.

When I checked that table, I found that one of the records had a value for mailing_backend of "N.". I thought the value for "mailing_backend" ought to be either NULL (since I hadn't set it before) or NULL, so I set the value to NULL.

That fixed it. When I went back and entered my mailing settings, they were saved without error and they worked.

When I went back and checked the table, the NULL value for mailing_backend had changed to show the mailing parameters I had set.

palmquist

  • I post occasionally
  • **
  • Posts: 34
  • Karma: 2
  • CiviCRM version: 4.5.6
  • CMS version: Drupal 7.26
  • MySQL version: 5.5.36-log
  • PHP version: 5.4.24
Re: *** Solved *** Global Settings SMTP sends email but won't save settings
July 27, 2010, 09:07:34 pm
I had a similar problem, which was also solved by setting mailing_backend to NULL (when it previously was set to "N;"). 

I had been dealing with this problem for several months, after asking for help here on this forum and trying similar suggestions (such as "upgrade" etc.) which proved fruitless.  Finally I contacted several CiviCRM professionals as listed on this site.  Each of them said that they would be happy to fix my problem, as long as I was willing to spend hundreds of dollars (estimates ranged from $300 to $600+).

I told each of them that I wasn't expecting them to do all of the work in solving the problem, but just to point me in the right direction.  I would have happily paid a reasonable amount of money for some reasonable help, but spending hundreds of dollars didn't seem reasonable.  So I lived with the problem for months, occasionally going back and trying to figure out how to solve it.

Through the use of some debugging tools, I finally was on the verge of solving the problem (having just found a reference to mailing_backend) when I came upon this post here today.  I had dealt with config_backend previously so I was familiar with the concept, but I didn't even know that a mailing_backend existed before.

Having been a C++ programmer for many years (but having not yet learned PHP) I am not clueless but needed some help.  It seems to me that if the CiviCRM community wants to be a "self-help" community and wants to encourage more contributors in the future, the community should do a better job at helping to facilitate reasonable solutions to problems like this. 

Fixing the problem took less than a minute, but it cost me months of frustration and countless hours of debugging (of course, it helped me to learn more about CiviCRM, Drupal, and PHP, so it wasn't a complete waste of time).   


With the CiviCRM community centered around free software and high-priced professionals, it seems obvious to me that we are missing something in the middle.





Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: *** Solved *** Global Settings SMTP sends email but won't save settings
July 28, 2010, 01:42:35 am
palmquist:

I guess by mailing_backend you meant config_backend? This is one of the most common problem people have when they migrate or sometimes due to unknown reasons. So if you would have searched forum or even checked wiki it might have helped you to fix it earlier and avoid unnecessary frustration.

Upgrade and fixing unknown issues might take lot of time, so IMO you should be willing to spent / pay for at least 5-6 hours for debugging. CiviCRM irc channel is also quite active, so you can also get help from community / core members.

CiviCRM is free / open source and like any other open source software it has its merits and disadvantages..

Kurund


« Last Edit: July 28, 2010, 01:44:47 am by Kurund Jalmi »
Found this reply helpful? Support CiviCRM

palmquist

  • I post occasionally
  • **
  • Posts: 34
  • Karma: 2
  • CiviCRM version: 4.5.6
  • CMS version: Drupal 7.26
  • MySQL version: 5.5.36-log
  • PHP version: 5.4.24
Re: *** Solved *** Global Settings SMTP sends email but won't save settings
July 29, 2010, 10:04:59 am
Quote from: Kurund Jalmi on July 28, 2010, 01:42:35 am

I guess by mailing_backend you meant config_backend? This is one of the most common problem people have when they migrate or sometimes due to unknown reasons. So if you would have searched forum or even checked wiki it might have helped you to fix it earlier and avoid unnecessary frustration....


No, I meant mailing_backend, not config_backend.  Of course in my struggles of learning/upgrading/debugging CiviCRM issues I had already dealt with config_backend, but I don't see any documentation anywhere (except for this thread) referring to mailing_backend.  Can you tell me where I can find such documentation?

As a programmer (still admittedly far behind in the CiviCRM/Drupal/PHP learning curve), I am willing to spend my own time tracking down issues, but of course I do need some documentation to be able to do so.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Installing CiviCRM »
  • Drupal Installations (Moderator: Piotr Szotkowski) »
  • *** Solved *** Global Settings SMTP sends email but won't save settings

This forum was archived on 2017-11-26.