Inherit duration from parent set

This commit is contained in:
Wojtek
2026-10-16 11:15:13 +02:00
parent 3ee0b22d75
commit 96e8a4a0f5
7 changed files with 27 additions and 6 deletions
@@ -133,6 +133,10 @@ class SetModel extends AdminModel
if ($parentId > 0) {
$data['set_type'] = 'variant';
$parent = $this->getItem($parentId);
if ($parent) {
$data['duration'] = (int) $parent->duration;
}
} elseif (!in_array(($data['set_type'] ?? 'ordinary'), ['ordinary', 'multi'], true)) {
$data['set_type'] = 'ordinary';
}