Commit 2616a25
committed
Fix issue #7956: PHP 8 compatibility for custom field integer types
PHP 8 changed loose comparison behavior: '' != 0 is now true (was false in PHP 7).
This caused empty custom field values to be written as '' instead of NULL
for integer/list columns (types 8, 9, 12), triggering MySQL error:
'Incorrect integer value: '' for column'
Changes:
- Functions.php: Replace loose comparison with explicit empty/null/zero checks
in sqlCustomField(); cast values to (int) for safer integer column inserts
- InputUtils.php: legacyFilterInput() now returns type-appropriate empty values
(0 for int, 0.0 for float) instead of always returning ''
Affects: FamilyEditor, PersonEditor, GroupPropsEditor, CSVImport1 parent ddaf790 commit 2616a25
2 files changed
+15
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
182 | 182 | | |
183 | 183 | | |
184 | 184 | | |
185 | | - | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
186 | 195 | | |
187 | 196 | | |
188 | 197 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
937 | 937 | | |
938 | 938 | | |
939 | 939 | | |
940 | | - | |
941 | | - | |
942 | | - | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
943 | 943 | | |
| 944 | + | |
| 945 | + | |
944 | 946 | | |
945 | 947 | | |
946 | 948 | | |
| |||
0 commit comments