Skip to content

Commit

Permalink
Add fix for empty notes edge case
Browse files Browse the repository at this point in the history
  • Loading branch information
paul121 committed May 31, 2024
1 parent 129a948 commit 276b710
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,12 @@ function farm_rothamsted_notification_compare_entity_fields(array $array1, array
}
// Field length differences.
elseif (count($value) !== count($array2[$key])) {
// Check that a value actually exists when comparing compound fields.
// This fixes a bug where notes always appears to be changing when
// there is no value.
if (count($value) === 0 && isset($array2[$key][0]) && is_null($array2[$key][0]['value'])) {
continue;
}
$difference[] = $key;
}
// Recursive difference.
Expand Down

0 comments on commit 276b710

Please sign in to comment.