craftcms / feed-me

Craft CMS plugin for importing entry data from XML, RSS or ATOM feeds—routine task or on-demand.
Other
288 stars 139 forks source link

XML Feed - Empty Values #1469

Closed DenyEs closed 2 months ago

DenyEs commented 3 months ago

Description

I did some testing with a XML feed I have - simplified example below.

XML below creates an entry and adds all values.

<Items xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <Item>
    <Id>1</Id>
    <Value>150.00</Value>
  </Item>
</Items>

When I remove the value and try to set it as empty, Feedme comes back saying Node 1 skipped, content has not changed. I tried multiple variation of setting the value as empty including xis:nil="true" but nothing seems to work.

<Items xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <Item>
    <Id>1</Id>
    <Value />
  </Item>
</Items>

I tried to add 'compareContent' => true to the feed-me.php config file but again, no luck.

Steps to reproduce

  1. Create a simple XML feed with a value
  2. Run the feed
  3. Remove the value
  4. Entry should be as it was before, value was kept and not removed

Additional info

i-just commented 3 months ago

Hi, thanks for reporting! I raised a PR for this.

angrybrad commented 2 months ago

Resolved in https://github.com/craftcms/feed-me/pull/1473 and will be included in the next 5 and 6 releases.