diff --git a/database/factories/CheckoutAcceptanceFactory.php b/database/factories/CheckoutAcceptanceFactory.php index bb56ab2b4a..1cd139176e 100644 --- a/database/factories/CheckoutAcceptanceFactory.php +++ b/database/factories/CheckoutAcceptanceFactory.php @@ -23,23 +23,39 @@ class CheckoutAcceptanceFactory extends Factory 'assigned_to_id' => User::factory(), ]; } + protected static bool $skipActionLog = false; + + public function withoutActionLog(): static + { + // turn off for this create() call + static::$skipActionLog = true; + + // ensure it turns back on AFTER creating + return $this->afterCreating(function () { + static::$skipActionLog = false; + }); + } public function configure(): static { return $this->afterCreating(function (CheckoutAcceptance $acceptance) { + if (static::$skipActionLog) { + return; // short-circuit + } if ($acceptance->checkoutable instanceof Asset) { $this->createdAssociatedActionLogEntry($acceptance); } if ($acceptance->checkoutable instanceof Asset && $acceptance->assignedTo instanceof User) { $acceptance->checkoutable->update([ - 'assigned_to' => $acceptance->assigned_to_id, - 'assigned_type' => get_class($acceptance->assignedTo), + 'assigned_to' => $acceptance->assigned_to_id, + 'assigned_type'=> get_class($acceptance->assignedTo), ]); } }); } + public function forAccessory() { return $this->state([ diff --git a/upgrade.php b/upgrade.php index b98162ed96..eaf88bf931 100644 --- a/upgrade.php +++ b/upgrade.php @@ -62,6 +62,7 @@ if ($argc > 1){ break; case '--no-interactive': $no_interactive = true; + putenv("COMPOSER_NO_INTERACTION=1"); //put composer in non-interactive mode aswell break; default: // for legacy support from before we started using --branch $branch = $argv[$arg]; @@ -443,7 +444,8 @@ if ((strpos('git version', $git_version)) === false) { echo $git_fetch; echo '-- '.$git_stash; echo '-- '.$git_checkout; - echo '-- '.$git_pull."\n"; + echo '-- '.$git_pull; + echo "\n"; } else { echo "Git is NOT installed. You can still use this upgrade script to run common \n"; echo "migration commands, but you will have to manually download the updated files. \n\n";