1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-27 01:02:42 +01:00

Add missing (int) casts to Herald rule editing

Summary: Fixes T3792. These raise errors if the database is in strict mode and you try to create an "any" rule.

Test Plan: Created a rule with "any".

Reviewers: btrahan, chad

Reviewed By: chad

CC: aran

Maniphest Tasks: T3792

Differential Revision: https://secure.phabricator.com/D6883
This commit is contained in:
epriestley 2013-09-04 12:07:26 -07:00
parent 589f1c7696
commit 0ae7335316

View file

@ -35,7 +35,7 @@ final class HeraldRuleController extends HeraldController {
} else { } else {
$rule = new HeraldRule(); $rule = new HeraldRule();
$rule->setAuthorPHID($user->getPHID()); $rule->setAuthorPHID($user->getPHID());
$rule->setMustMatchAll(true); $rule->setMustMatchAll(1);
$content_type = $request->getStr('content_type'); $content_type = $request->getStr('content_type');
$rule->setContentType($content_type); $rule->setContentType($content_type);
@ -206,7 +206,8 @@ final class HeraldRuleController extends HeraldController {
private function saveRule(HeraldAdapter $adapter, $rule, $request) { private function saveRule(HeraldAdapter $adapter, $rule, $request) {
$rule->setName($request->getStr('name')); $rule->setName($request->getStr('name'));
$rule->setMustMatchAll(($request->getStr('must_match') == 'all')); $match_all = ($request->getStr('must_match') == 'all');
$rule->setMustMatchAll((int)$match_all);
$repetition_policy_param = $request->getStr('repetition_policy'); $repetition_policy_param = $request->getStr('repetition_policy');
$rule->setRepetitionPolicy( $rule->setRepetitionPolicy(