Fix issue where a scoring guide subscore could not be created if advancement was not enabled.

This commit is contained in:
Matt Young 2025-10-16 11:53:15 -05:00
parent 31d56e5b90
commit 70f79d031c
1 changed files with 5 additions and 0 deletions

View File

@ -9,6 +9,7 @@ use App\Models\SubscoreDefinition;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
use function auditionSetting;
use function request;
use function response;
@ -81,6 +82,10 @@ class ScoringGuideController extends Controller
// Put the new subscore at the end of the list for both display and tiebreak order
$display_order = SubscoreDefinition::where('scoring_guide_id', '=', $guide->id)->max('display_order') + 1;
$tiebreak_order = SubscoreDefinition::where('scoring_guide_id', '=', $guide->id)->max('tiebreak_order') + 1;
if (! auditionSetting('advanceTo')) {
$validateData['for_advance'] = 0;
$validateData['for_seating'] = 1;
}
SubscoreDefinition::create([
'scoring_guide_id' => $guide->id,