Skip to content

fix comparing content for a "simple" field that already has an empty value#1621

Merged
angrybrad merged 1 commit into5.xfrom
bugfix/1615-empty-values-and-compare-content
Apr 20, 2025
Merged

fix comparing content for a "simple" field that already has an empty value#1621
angrybrad merged 1 commit into5.xfrom
bugfix/1615-empty-values-and-compare-content

Conversation

@i-just
Copy link
Contributor

@i-just i-just commented Apr 3, 2025

Description

If you’re importing into a feed with setEmptyValues turned on, compareContent set to true (default), you have an existing element with a field that’s already empty, and you’re importing an empty value into that field, the content comparison was incorrectly reporting that the content has changed.

This happened because the Hash::check will always return false if the key exists but the value is null, causing the content to never actually get compared.

(Hash::extract will return an empty array causing Hash::check to return false.)

Related issues

#1615

@i-just i-just requested a review from angrybrad as a code owner April 3, 2025 09:02
@angrybrad angrybrad merged commit 4f68a22 into 5.x Apr 20, 2025
6 checks passed
@angrybrad angrybrad deleted the bugfix/1615-empty-values-and-compare-content branch April 20, 2025 03:40
angrybrad added a commit that referenced this pull request Apr 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants