craftcms / feed-me

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

Importing a tree structure incorrectly thinks that the parent changed every time #1372

Open boudewijn-zicht opened 8 months ago

boudewijn-zicht commented 8 months ago

Description

When you configure an import with a parent (i.e. importing a tree structure) the import uses the parent attribute where the id of the parent element is stored. However, in Craft this attribute is called parentId. This results in a bug where every child element will incorrectly determine that its parent has changed.

This in turn results in an additional element save and its associated overhead in DB calls and element revisions.

Steps to reproduce

  1. Configure an import with a nested structure
  2. Run the feed in debug and see that none of the child elements will say that the element was skipped, see image below image

A fix is available here: https://github.com/craftcms/feed-me/pull/1313. With the changes in this PR every child element will correctly determine that it has not changed and can be skipped, see image below image

Additional info