Commit 8fa65fd
committed
graph: Exclude VID from change detection in merge_remove_null_fields
Entity::merge_remove_null_fields iterates via the raw Object iterator
which, unlike every other Entity API, does not filter the VID field.
Since EntityCache::set stamps a fresh VID on every save, the VID always
differs from the stored entity's VID, causing merge_remove_null_fields
to report a change even when the user-visible data is identical. This
produces a spurious Overwrite modification (and therefore a new row in
the database) each time an unchanged entity is re-saved.
Skip the VID when computing the changed flag while still merging it
into the entity so downstream code (e.g. store insert queries) sees
the latest value.1 parent e4dfe52 commit 8fa65fd
1 file changed
+35
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1017 | 1017 | | |
1018 | 1018 | | |
1019 | 1019 | | |
| 1020 | + | |
| 1021 | + | |
| 1022 | + | |
| 1023 | + | |
1020 | 1024 | | |
1021 | 1025 | | |
1022 | | - | |
| 1026 | + | |
1023 | 1027 | | |
1024 | 1028 | | |
1025 | 1029 | | |
1026 | 1030 | | |
1027 | 1031 | | |
1028 | 1032 | | |
1029 | | - | |
| 1033 | + | |
1030 | 1034 | | |
1031 | 1035 | | |
1032 | 1036 | | |
| |||
1388 | 1392 | | |
1389 | 1393 | | |
1390 | 1394 | | |
| 1395 | + | |
| 1396 | + | |
| 1397 | + | |
| 1398 | + | |
| 1399 | + | |
| 1400 | + | |
| 1401 | + | |
| 1402 | + | |
| 1403 | + | |
| 1404 | + | |
| 1405 | + | |
| 1406 | + | |
| 1407 | + | |
| 1408 | + | |
| 1409 | + | |
| 1410 | + | |
| 1411 | + | |
| 1412 | + | |
| 1413 | + | |
| 1414 | + | |
| 1415 | + | |
| 1416 | + | |
| 1417 | + | |
| 1418 | + | |
| 1419 | + | |
| 1420 | + | |
| 1421 | + | |
| 1422 | + | |
| 1423 | + | |
0 commit comments