Skip to content

Commit

Permalink
fix custom field checkbox
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaomlove committed Nov 16, 2022
1 parent fad1f9c commit 1ee9a0c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nexus/Field/Field.php
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ public function listTorrentCustomField($torrentId, $searchBoxId)
}
$result[$row['torrent_id']][$row['id']] = $row;
if ($typeInfo['is_value_multiple']) {
$values[$row['torrent_id']][$row['id']][] = $row['custom_field_value'];
$values[$row['torrent_id']][$row['id']] = json_decode($row['custom_field_value'], true);
} else {
$values[$row['torrent_id']][$row['id']] = $row['custom_field_value'];
}
Expand Down Expand Up @@ -529,7 +529,7 @@ public function saveFieldValues($searchBoxId, $torrentId, array $data)
$insert[] = [
'torrent_id' => $torrentId,
'custom_field_id' => $field->id,
'custom_field_value' => $data[$field->id],
'custom_field_value' => is_array($data[$field->id]) ? json_encode($data[$field->id]) : $data[$field->id],
'created_at' => $now,
'updated_at' => $now,
];
Expand Down

0 comments on commit 1ee9a0c

Please sign in to comment.