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

Assets field maxRelations is not respected when importing #1354

Closed i-just closed 11 months ago

i-just commented 11 months ago

Description

Importing into assets field - max relations limit is not respected. For example, if you have an assets field with max relations set to 1 and you have 3 assets mapped to that field, all 3 will be imported and related to the field.

Steps to reproduce

  1. create an assets field with max relations set to 1
  2. add that field to a section element type
  3. create a feed and map that assets field
  4. run import and see that all images from the feed were imported, ignoring the max relations limit

Example feed:

{
    "entries": {
        "title": "my test entry",
        "photos": [
            "<url>/puppy-chew-toy1.jpg",
            "<url>/puppies.jpeg"
        ],
    }
}

Additional info

angrybrad commented 11 months ago

Resolved in https://github.com/craftcms/feed-me/pull/1355 and will be included in the next v5 release.