Skip to content

Commit

Permalink
Merge pull request #1370 from JeffreyBenusa/bugfix/simpleArrayCompare
Browse files Browse the repository at this point in the history
Added check for simple arrays for newValues within existingValues
  • Loading branch information
angrybrad authored Nov 25, 2023
2 parents 51a9327 + 50ec6da commit 34b219c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/helpers/DataHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,12 @@ public static function compareElementContent($content, $element)
$newValue = null;
}

// If array key & values are already within the existing array
if (is_array($newValue) && is_array($existingValue) && Hash::contains($existingValue,$newValue)) {
unset($trackedChanges[$key]);
continue;
}

// Check for simple fields first
if (self::_compareSimpleValues($fields, $key, $existingValue, $newValue)) {
unset($trackedChanges[$key]);
Expand Down

0 comments on commit 34b219c

Please sign in to comment.