mirror of
				https://github.com/firefly-iii/firefly-iii.git
				synced 2025-11-03 20:55:05 +00:00 
			
		
		
		
	Fix an issue where new users would be given a rule that always triggers.
This commit is contained in:
		@@ -541,6 +541,7 @@ class RuleController extends Controller
 | 
			
		||||
                'title'               => trans('firefly.default_rule_name'),
 | 
			
		||||
                'description'         => trans('firefly.default_rule_description'),
 | 
			
		||||
                'trigger'             => 'store-journal',
 | 
			
		||||
                'strict'              => true,
 | 
			
		||||
                'rule-trigger-values' => [
 | 
			
		||||
                    trans('firefly.default_rule_trigger_description'),
 | 
			
		||||
                    trans('firefly.default_rule_trigger_from_account'),
 | 
			
		||||
 
 | 
			
		||||
@@ -31,6 +31,7 @@ use FireflyIII\TransactionRules\Actions\ActionInterface;
 | 
			
		||||
use FireflyIII\TransactionRules\Factory\ActionFactory;
 | 
			
		||||
use FireflyIII\TransactionRules\Factory\TriggerFactory;
 | 
			
		||||
use FireflyIII\TransactionRules\Triggers\AbstractTrigger;
 | 
			
		||||
use FireflyIII\TransactionRules\Triggers\UserAction;
 | 
			
		||||
use Illuminate\Support\Collection;
 | 
			
		||||
use Log;
 | 
			
		||||
 | 
			
		||||
@@ -279,11 +280,14 @@ final class Processor
 | 
			
		||||
                Log::debug('Is a match!');
 | 
			
		||||
                ++$hitTriggers;
 | 
			
		||||
                // is non-strict? then return true!
 | 
			
		||||
                if (!$this->strict) {
 | 
			
		||||
                if (!$this->strict && UserAction::class !== \get_class($trigger)) {
 | 
			
		||||
                    Log::debug('Rule is set as non-strict, return true!');
 | 
			
		||||
 | 
			
		||||
                    return true;
 | 
			
		||||
                }
 | 
			
		||||
                if (!$this->strict && UserAction::class === \get_class($trigger)) {
 | 
			
		||||
                    Log::debug('Rule is set as non-strict, but action was "user-action". Will not return true.');
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
            if ($trigger->stopProcessing) {
 | 
			
		||||
                Log::debug('Stop processing this trigger and break.');
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user