migrate searchbox to mode related

This commit is contained in:
xiaomlove
2022-09-13 19:21:05 +08:00
parent cee206df4c
commit f2c4a7d30f
12 changed files with 168 additions and 30 deletions

View File

@@ -20,16 +20,7 @@ class EditSection extends EditRecord
protected function mutateFormDataBeforeSave(array $data): array
{
foreach (SearchBox::$subCatFields as $field) {
$data["show{$field}"] = 0;
foreach ($data['extra'][SearchBox::EXTRA_TAXONOMY_LABELS] ?? [] as $item) {
if ($field == $item['torrent_field']) {
$data["show{$field}"] = 1;
$data["extra->" . SearchBox::EXTRA_TAXONOMY_LABELS][] = $item;
}
}
}
return $data;
return SearchBox::formatTaxonomyExtra($data);
}
}