Skip to content

Commit

Permalink
Bugfix: format string in customfields only for string
Browse files Browse the repository at this point in the history
  • Loading branch information
eynimeni committed Dec 5, 2024
1 parent cce2a69 commit 82cde19
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions classes/option/fields/customfields.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,11 +202,13 @@ public static function save_data(stdClass &$formdata, stdClass &$option): array
// Only report that there was change in the section.
// Can be extended when needed.
$fieldname = $data->get_field()->get('name') ?? $key;
$oldvalue = is_string($oldvalue) ? format_string($oldvalue) : $oldvalue;
$newvalue = is_string($newvalue) ? format_string($newvalue) : $newvalue;
$changes[$key] = [
'changes' => [
'fieldname' => 'customfields',
'oldvalue' => $fieldname . ' : ' . format_string($oldvalue),
'newvalue' => $fieldname . ' : ' . format_string($newvalue),
'oldvalue' => $fieldname . ' : ' . $oldvalue,
'newvalue' => $fieldname . ' : ' . $newvalue,
],
];
}
Expand Down

0 comments on commit 82cde19

Please sign in to comment.