Answers.Body: <p>To suppress these messages, add the following code to your <code>settings.php</code> or <code>civicrm.settings.php</code></p>
  
  <pre><code>ini_set('error_reporting', E_ALL &amp; ~E_DEPRECATED &amp; ~E_NOTICE);
  </code></pre>
  
  <p><a href="https://drupal.stackexchange.com/questions/51744/e-deprecated-and-e-notice-errors-showing-in-dblog-syslog-despite-disabling-in">Long answer on Drupal Answers</a>.</p>
  
  <p>CiviCRM generates a substantial number of <code>E_NOTICE</code> messages - these are <em>notices</em>, which is less severe than <em>warnings</em>. If they bother you, submitting patches to address them is a great way to start contributing code to CiviCRM!</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-02-12T06:01:49.883Z
Answers.Text: So I take it this means you think there is too much error reporting going on and I should lower what is being reported using setting.php
Answers.UserDisplayName: Josh
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-02-12T06:11:42.473Z
Answers.Text: This seems to have worked, the error no longer get shoved in the users face. I can't find anything broken so I'll call this fixed.
Answers.UserDisplayName: Josh
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-02-12T01:00:05.160Z
Answers.LastActivityDate: 2016-02-12T01:05:23.723Z
Answers.LastEditDate: 2017-04-13T12:47:16.150Z
Answers.UserDisplayName: Chris Burgess
Body: <p>I've just migrated a civiCRM instance from Joomla! to Drupal. Everything I've tried so far works and it's the best thing ever. I find everything we want to do so much easier to get around in Drupal. </p>
  
  <p>One problem:</p>
  
  <p>When a user makes a new account, using a civiCRM profile I've made, I get all these errors:</p>
  
  <blockquote>
    <p>Notice: Undefined index: contact_sub_type in
    CRM_Contact_BAO_Contact::formatProfileContactParams() (line 2010 of
    [redacted]/sites/all/modules/civicrm/CRM/Contact/BAO/Contact.php).
    Warning: in_array() expects parameter 2 to be array, null given in
    CRM_Contact_BAO_Contact::formatProfileContactParams() (line 2011 of
    [redacted]/sites/all/modules/civicrm/CRM/Contact/BAO/Contact.php).
    Notice: Undefined index: contact_sub_type in
    CRM_Contact_BAO_Contact::formatProfileContactParams() (line 2012 of
    [redacted]/sites/all/modules/civicrm/CRM/Contact/BAO/Contact.php).
    Notice: Trying to get property of non-object in
    CRM_Mailing_BAO_Mailing->getTemplates() (line 763 of
    [redacted]/sites/all/modules/civicrm/CRM/Mailing/BAO/Mailing.php).
    Notice: Trying to get property of non-object in
    CRM_Mailing_BAO_Mailing->getTemplates() (line 767 of
    [redacted]/sites/all/modules/civicrm/CRM/Mailing/BAO/Mailing.php).
    Notice: Trying to get property of non-object in
    CRM_Mailing_BAO_Mailing->getTemplates() (line 777 of
    [redacted]/sites/all/modules/civicrm/CRM/Mailing/BAO/Mailing.php).
    Notice: Trying to get property of non-object in
    CRM_Mailing_BAO_Mailing->getTemplates() (line 781 of
    [redacted]/sites/all/modules/civicrm/CRM/Mailing/BAO/Mailing.php).</p>
  </blockquote>
  
  <p>They are filling in custom fields at this point of registration, and some of them are multi valued if that has any bearing on anything.</p>
  
  <p>Also when updating details of a user I get:</p>
  
  <blockquote>
    <p>Notice: Trying to get property of non-object in
    CRM_Mailing_BAO_Mailing->getTemplates() (line 781 of
    [redacted]/sites/all/modules/civicrm/CRM/Mailing/BAO/Mailing.php).
    Notice: Trying to get property of non-object in
    CRM_Mailing_BAO_Mailing->getTemplates() (line 767 of
    [redacted]/sites/all/modules/civicrm/CRM/Mailing/BAO/Mailing.php).
    Notice: Trying to get property of non-object in
    CRM_Mailing_BAO_Mailing->getTemplates() (line 777 of
    [redacted]/sites/all/modules/civicrm/CRM/Mailing/BAO/Mailing.php).
    Notice: Trying to get property of non-object in
    CRM_Mailing_BAO_Mailing->getTemplates() (line 763 of
    [redacted]/sites/all/modules/civicrm/CRM/Mailing/BAO/Mailing.php).</p>
  </blockquote>
  
  <p>Again, we are updating those custom multi valued fields using a profile. No, I tell a lie, there are still custom fields, but not multi valued ones here.</p>
  
  <p>This does not happen updating user details using the civiCRM administrative interface. Everything is fine there.</p>
  
  <p>Any hints what the issue could be? does it matter? I'm yet to find anything that does not work, it just regularly throws these errors up. It does matter from a user experience point of view, I at least want to hide these messages. I have not quite finished testing everything though.</p>
  
  <p>This is also on new hosting, so databases have been restored and such. Possibly there is something this host is not doing? but I can't think what it could be.</p>
  
  <p>[edit] Found something that does not work. Removing contacts from a group. When I remove a contact from a group they are immediately added back with a status of "Added (by API)" Date added being the time you removed the group. You see this immediately in the administrative interface. Not sure that this is possibly related.
  [edit again] no, only some groups. Some groups remove just fine, I think this is group thing is a drupal group sync thing (greatest thing ever by the way!)[edit again] yes, group sync thing, I had an extra rule making a bit of an infinite loop: not related to the above problem. ignore this please.</p>
  
Tags: <drupal><joomla><migration>
Title: Error messages galore from contact.php and mailing.php, but eveything works? Should I worry? how do I fix it?
ThreadText: # Error messages galore from contact.php and mailing.php, but eveything works? Should I worry? how do I fix it?
  
  (Asked by: username_0 on 2016-02-11)
  
  I've just migrated a civiCRM instance from Joomla! to Drupal. Everything I've tried so far works and it's the best thing ever. I find everything we want to do so much easier to get around in Drupal.
  
  One problem:
  
  When a user makes a new account, using a civiCRM profile I've made, I get all these errors:
  
  > Notice: Undefined index: contact\_sub\_type in
  > CRM\_Contact\_BAO\_Contact::formatProfileContactParams() (line 2010 of
  > [redacted]/sites/all/modules/civicrm/CRM/Contact/BAO/Contact.php).
  > Warning: in\_array() expects parameter 2 to be array, null given in
  > CRM\_Contact\_BAO\_Contact::formatProfileContactParams() (line 2011 of
  > [redacted]/sites/all/modules/civicrm/CRM/Contact/BAO/Contact.php).
  > Notice: Undefined index: contact\_sub\_type in
  > CRM\_Contact\_BAO\_Contact::formatProfileContactParams() (line 2012 of
  > [redacted]/sites/all/modules/civicrm/CRM/Contact/BAO/Contact.php).
  > Notice: Trying to get property of non-object in
  > CRM\_Mailing\_BAO\_Mailing->getTemplates() (line 763 of
  > [redacted]/sites/all/modules/civicrm/CRM/Mailing/BAO/Mailing.php).
  > Notice: Trying to get property of non-object in
  > CRM\_Mailing\_BAO\_Mailing->getTemplates() (line 767 of
  > [redacted]/sites/all/modules/civicrm/CRM/Mailing/BAO/Mailing.php).
  > Notice: Trying to get property of non-object in
  > CRM\_Mailing\_BAO\_Mailing->getTemplates() (line 777 of
  > [redacted]/sites/all/modules/civicrm/CRM/Mailing/BAO/Mailing.php).
  > Notice: Trying to get property of non-object in
  > CRM\_Mailing\_BAO\_Mailing->getTemplates() (line 781 of
  > [redacted]/sites/all/modules/civicrm/CRM/Mailing/BAO/Mailing.php).
  
  They are filling in custom fields at this point of registration, and some of them are multi valued if that has any bearing on anything.
  
  Also when updating details of a user I get:
  
  > Notice: Trying to get property of non-object in
  > CRM\_Mailing\_BAO\_Mailing->getTemplates() (line 781 of
  > [redacted]/sites/all/modules/civicrm/CRM/Mailing/BAO/Mailing.php).
  > Notice: Trying to get property of non-object in
  > CRM\_Mailing\_BAO\_Mailing->getTemplates() (line 767 of
  > [redacted]/sites/all/modules/civicrm/CRM/Mailing/BAO/Mailing.php).
  > Notice: Trying to get property of non-object in
  > CRM\_Mailing\_BAO\_Mailing->getTemplates() (line 777 of
  > [redacted]/sites/all/modules/civicrm/CRM/Mailing/BAO/Mailing.php).
  > Notice: Trying to get property of non-object in
  > CRM\_Mailing\_BAO\_Mailing->getTemplates() (line 763 of
  > [redacted]/sites/all/modules/civicrm/CRM/Mailing/BAO/Mailing.php).
  
  Again, we are updating those custom multi valued fields using a profile. No, I tell a lie, there are still custom fields, but not multi valued ones here.
  
  This does not happen updating user details using the civiCRM administrative interface. Everything is fine there.
  
  Any hints what the issue could be? does it matter? I'm yet to find anything that does not work, it just regularly throws these errors up. It does matter from a user experience point of view, I at least want to hide these messages. I have not quite finished testing everything though.
  
  This is also on new hosting, so databases have been restored and such. Possibly there is something this host is not doing? but I can't think what it could be.
  
  [edit] Found something that does not work. Removing contacts from a group. When I remove a contact from a group they are immediately added back with a status of "Added (by API)" Date added being the time you removed the group. You see this immediately in the administrative interface. Not sure that this is possibly related.
  [edit again] no, only some groups. Some groups remove just fine, I think this is group thing is a drupal group sync thing (greatest thing ever by the way!)[edit again] yes, group sync thing, I had an extra rule making a bit of an infinite loop: not related to the above problem. ignore this please.
  
  **Tags:** drupal, joomla, migration
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2016-02-12. Score: 1 | Accepted answer
  
  To suppress these messages, add the following code to your `settings.php` or `civicrm.settings.php`
  
  ```
  ini_set('error_reporting', E_ALL & ~E_DEPRECATED & ~E_NOTICE);
  
  ```
  
  [Long answer on Drupal Answers](https://drupal.stackexchange.com/questions/51744/e-deprecated-and-e-notice-errors-showing-in-dblog-syslog-despite-disabling-in).
  
  CiviCRM generates a substantial number of `E_NOTICE` messages - these are *notices*, which is less severe than *warnings*. If they bother you, submitting patches to address them is a great way to start contributing code to CiviCRM!
  
  > **Comments:**
  > **username_0**: So I take it this means you think there is too much error reporting going on and I should lower what is being reported using setting.php  
  > **username_0**: This seems to have worked, the error no longer get shoved in the users face. I can't find anything broken so I'll call this fixed.  
  
  ---
  
  