Skip to content

Commit

Permalink
email_me is integer, fixes: General error: 1366 Incorrect integer val…
Browse files Browse the repository at this point in the history
…ue: '' for column 'email_me' at row 1

https://travis-ci.org/piwik/piwik/jobs/25436325
  • Loading branch information
mattab committed May 18, 2014
1 parent 2a0c807 commit 6a461e8
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Model.php
Expand Up @@ -391,7 +391,7 @@ private function completeAlerts($alerts)
foreach ($alerts as &$alert) {
$alert['additional_emails'] = json_decode($alert['additional_emails']);
$alert['phone_numbers'] = json_decode($alert['phone_numbers']);
$alert['email_me'] = (bool) $alert['email_me'];
$alert['email_me'] = (int) $alert['email_me'];
$alert['compared_to'] = (int) $alert['compared_to'];
$alert['id_sites'] = $this->getDefinedSiteIds($alert['idalert']);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/ApiTest.php
Expand Up @@ -463,7 +463,7 @@ public function test_triggerAlert_getTriggeredAlertsForPeriod_ShouldMarkAlertAsT
'value_old' => 48,
'additional_emails' => array('test1@example.com', 'test2@example.com'),
'phone_numbers' => array(),
'email_me' => false,
'email_me' => 0,
'compared_to' => 1,
'id_sites' => array(1, 2)
);
Expand Down
2 changes: 1 addition & 1 deletion tests/ControllerTest.php
Expand Up @@ -210,7 +210,7 @@ private function buildAlert($id, $name, $period = 'week', $idSite = 1, $siteName
'metric_matched' => $metricMatched,
'additional_emails' => array('test5@example.com'),
'phone_numbers' => array('+1234567890', '232'),
'email_me' => true,
'email_me' => 1,
'value_new' => '4493.000',
'value_old' => '228.128',
'ts_triggered' => time()
Expand Down
2 changes: 1 addition & 1 deletion tests/ModelTest.php
Expand Up @@ -193,7 +193,7 @@ public function test_triggerAlert_getTriggeredAlertsForPeriod_ShouldMarkAlertAsT
'value_old' => 48.519,
'additional_emails' => array('test1@example.com', 'test2@example.com'),
'phone_numbers' => array('0123456789'),
'email_me' => false,
'email_me' => 0,
'id_sites' => array(1, 2)
);

Expand Down
2 changes: 1 addition & 1 deletion tests/NotifierTest.php
Expand Up @@ -200,7 +200,7 @@ private function buildAlert($id, $name, $period = 'week', $idSite = 1, $siteName
'metric_matched' => $metricMatched,
'additional_emails' => array('test5@example.com'),
'phone_numbers' => array('+1234567890', '232'),
'email_me' => true,
'email_me' => 1,
'value_new' => '4493.000',
'value_old' => '228.128',
'ts_triggered' => time()
Expand Down

0 comments on commit 6a461e8

Please sign in to comment.