Fix default value assignment in PageForm schema: Updated logic to ensure that when the default value is an array, the first element is used for header data assignment. This change improves data handling and consistency in form population.

This commit is contained in:
Ümit Tunç
2025-11-01 04:01:00 -03:00
parent 4c516453d6
commit 2a4b8bed42
@@ -573,6 +573,9 @@ class PageForm
$existingData[$key] === null ||
$existingData[$key] === '' ||
(is_array($existingData[$key]) && empty($existingData[$key]))) {
if(is_array($defaultValue)) {
$defaultValue = reset($defaultValue);
}
$set("header_data.{$key}", $defaultValue);
}
}