Make sure rules work.

This commit is contained in:
James Cole
2018-12-21 09:01:21 +01:00
parent a8ff77addd
commit a7e1a51476
10 changed files with 54 additions and 47 deletions

View File

@@ -268,7 +268,7 @@ trait RequestInformation
if (\is_array($data)) {
foreach ($data as $index => $triggerInfo) {
$triggers[] = [
'type' => $triggerInfo['name'] ?? '',
'type' => $triggerInfo['type'] ?? '',
'value' => $triggerInfo['value'] ?? '',
'stop_processing' => 1 === (int)($triggerInfo['stop_processing'] ?? '0'),
];

View File

@@ -54,13 +54,13 @@ trait RuleManagement
'active' => true,
'triggers' => [
[
'name' => 'description_is',
'type' => 'description_is',
'value' => (string)trans('firefly.default_rule_trigger_description'),
'stop_processing' => false,
],
[
'name' => 'from_account_is',
'type' => 'from_account_is',
'value' => (string)trans('firefly.default_rule_trigger_from_account'),
'stop_processing' => false,
@@ -69,12 +69,12 @@ trait RuleManagement
],
'actions' => [
[
'name' => 'prepend_description',
'type' => 'prepend_description',
'value' => (string)trans('firefly.default_rule_action_prepend'),
'stop_processing' => false,
],
[
'name' => 'set_category',
'type' => 'set_category',
'value' => (string)trans('firefly.default_rule_action_set_category'),
'stop_processing' => false,
],
@@ -102,7 +102,7 @@ trait RuleManagement
$triggers[] = view(
'rules.partials.action',
[
'oldAction' => $oldAction['name'],
'oldAction' => $oldAction['type'],
'oldValue' => $oldAction['value'],
'oldChecked' => 1 === (int)($oldAction['stop_processing'] ?? '0'),
'count' => $index + 1,
@@ -135,7 +135,7 @@ trait RuleManagement
$triggers[] = view(
'rules.partials.trigger',
[
'oldTrigger' => $oldTrigger['name'],
'oldTrigger' => $oldTrigger['type'],
'oldValue' => $oldTrigger['value'],
'oldChecked' => 1 === (int)($oldTrigger['stop_processing'] ?? '0'),
'count' => $index + 1,