craftcms / feed-me

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

Local asset mapping: FeedMe looks in the wrong folder #833

Open hiasl opened 3 years ago

hiasl commented 3 years ago

Description

My conclusion: It is wrong to resolve the folderId from the default upload location of the asset field.. It should be taken from the selected volumes for the asset field and it should also contain more than one folderId if more than one volume is configured.

Additional info

therealpecus commented 2 years ago

this bug or quirk is almost a year old but I found it because I have the same issue. To avoid a breaking change, there should be a preference that ignores the default upload location for the field being imported so that asset search can span the whole volume.

is this change possible?

setting a custom configuration would mean the user configuring FeedMe is aware of the potential risk with images with the same filename being available both in the root volume — where presumably would be found first — and in a subfolder, that could map the default upload location for the field.

@brandonkelly I've had a cursory look at the code but it's beyond my ability to provide a P.R.

Thanks!

hiasl commented 2 years ago

My opinion: Search in the default location first (and take the first match from there if there is any), but look in other possible volumes as well if they are configured. This would not be a breaking change and still solve the issue.

RetroChaos commented 2 years ago

This is very frustrating as this bug/oversight is still a problem even in 4.5.3. Is there any way to specify what asset volume / folder to look in on linking assets? Or provide a full path to an image as an option? We use Feed-Me quite a lot but it means each time I have to dump a load of assets in our default folder, link them, then move them to where they should be on the filesystem.

sg-modlab commented 1 year ago

Chiming in that we are hitting this issue as well right at the tail end of notable site redesign where we have to migrate a host of content.

sander-lameco commented 1 year ago

My opinion: Search in the default location first (and take the first match from there if there is any), but look in other possible volumes as well if they are configured. This would not be a breaking change and still solve the issue.

I agree with @hiasl, this would be the best way to tackle this. For now we are creating a new field mapping to the volume we want it to search in.