Answers.Body: <p>Beside having that big ugly message at the top, does it work properly?</p>
  
  <p>This is a WARNING, that can either be a missing validation of something from the developer, and could safely be ignored, or showing you the root of the problem.</p>
  
  <p>You mention moving from joomla to drupal, the issue might be that the link between a user (in the CMS) and her contact (in the CRM) aren't properly linked anymore. Is this warning displayed when you are authenticated or to an anonymous user?</p>
  
  <p>Anyway, if the discount works as expected, a quick workaround is to change the php configuration so it doesn't display NOTICE or WARNING online (I disable displaying them in production, mostly because they tend to be too verbose and disclose information like the path where I installed civi for instance that I'd rather keep private, for security reason)</p>
  
  <p>yo can change that by changing the default value or add a error_reporting line on your civicrm_settings.php
  <a href="http://php.net/manual/en/function.error-reporting.php" rel="nofollow">http://php.net/manual/en/function.error-reporting.php</a></p>
  
  <p>X+</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-11-02T12:10:55.963Z
Answers.Text: Yes, apart from having the horrible message it does work properly.
  No difference if the user is authenticated or anonymous. My user is actually re-created and properly linked in Drupal.
  
  Thanks for your help. I will try changing the php.
Answers.UserDisplayName: Jane Caldwell
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-10-30T09:25:51.547Z
Answers.LastActivityDate: 2015-10-30T09:25:51.547Z
Answers.UserDisplayName: Xavier
Body: <p>When you go to the registration page of an event that uses a discount code from <a href="https://civicrm.org/extensions/cividiscount" rel="nofollow">CiviDiscount</a>, this error appears several times in a big red error box at the top. If you scroll down far enough the actual registration form does appear. We have recently upgraded from an earlier version of Civi to 4.6.9, and from Joomla to Drupal. We have upgraded the CiviDiscount extension to 3.1 after doing the upgrade and migration.</p>
  
  <p>This error message is repeated:</p>
  
  <p>Warning: array_keys() expects parameter 1 to be array, null given in CRM_CiviDiscount_DiscountCalculator->filterDiscountsByContact() (line 108 of /home/registrationrig/www/www/sites/default/files/civicrm/extensions/org.civicrm.module.cividiscount/CRM/CiviDiscount/DiscountCalculator.php).
  Warning: Invalid argument supplied for foreach() in CRM_CiviDiscount_DiscountCalculator->filterDiscountsByContact() (line 108 of /home/registrationrig/www/www/sites/default/files/civicrm/extensions/org.civicrm.module.cividiscount/CRM/CiviDiscount/DiscountCalculator.php).</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-10-29T22:49:47.433Z
Comments.Text: pls update description with version of cividiscount
Comments.UserDisplayName: petednz - fuzion
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-11-02T12:02:09.440Z
Comments.Text: CiviDiscount is 3.1. Thanks
Comments.UserDisplayName: Jane Caldwell
Tags: <cividiscount>
Title: CiviDiscount big red box error appears at the top of an event that uses discounts
ThreadText: # CiviDiscount big red box error appears at the top of an event that uses discounts
  
  (Asked by: username_0 on 2015-10-29)
  
  When you go to the registration page of an event that uses a discount code from [CiviDiscount](https://civicrm.org/extensions/cividiscount), this error appears several times in a big red error box at the top. If you scroll down far enough the actual registration form does appear. We have recently upgraded from an earlier version of Civi to 4.6.9, and from Joomla to Drupal. We have upgraded the CiviDiscount extension to 3.1 after doing the upgrade and migration.
  
  This error message is repeated:
  
  Warning: array\_keys() expects parameter 1 to be array, null given in CRM\_CiviDiscount\_DiscountCalculator->filterDiscountsByContact() (line 108 of /home/registrationrig/www/www/sites/default/files/civicrm/extensions/org.civicrm.module.cividiscount/CRM/CiviDiscount/DiscountCalculator.php).
  Warning: Invalid argument supplied for foreach() in CRM\_CiviDiscount\_DiscountCalculator->filterDiscountsByContact() (line 108 of /home/registrationrig/www/www/sites/default/files/civicrm/extensions/org.civicrm.module.cividiscount/CRM/CiviDiscount/DiscountCalculator.php).
  
  **Tags:** cividiscount
  
  > **Comments:**
  > **username_1**: pls update description with version of cividiscount  
  > **username_0**: CiviDiscount is 3.1. Thanks  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2015-10-30. Score: 1
  
  Beside having that big ugly message at the top, does it work properly?
  
  This is a WARNING, that can either be a missing validation of something from the developer, and could safely be ignored, or showing you the root of the problem.
  
  You mention moving from joomla to drupal, the issue might be that the link between a user (in the CMS) and her contact (in the CRM) aren't properly linked anymore. Is this warning displayed when you are authenticated or to an anonymous user?
  
  Anyway, if the discount works as expected, a quick workaround is to change the php configuration so it doesn't display NOTICE or WARNING online (I disable displaying them in production, mostly because they tend to be too verbose and disclose information like the path where I installed civi for instance that I'd rather keep private, for security reason)
  
  yo can change that by changing the default value or add a error\_reporting line on your civicrm\_settings.php
  <http://php.net/manual/en/function.error-reporting.php>
  
  X+
  
  > **Comments:**
  > **username_0**: Yes, apart from having the horrible message it does work properly. No difference if the user is authenticated or anonymous. My user is actually re-created and properly linked in Drupal.  Thanks for your help. I will try changing the php.  
  
  ---
  
  