Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If photo url is blank, the search still finds a photo #582

Closed
alexmglover opened this issue Jul 25, 2019 · 7 comments
Closed

If photo url is blank, the search still finds a photo #582

alexmglover opened this issue Jul 25, 2019 · 7 comments
Labels

Comments

@alexmglover
Copy link

Description

When a user element's photo url is blank, the import still finds a photo.

It seems like the fix is to just add an empty($value) check and return before running the AssetElement search. I am not sure if this is a bug with the AssetElement query or if this was how it is intended to work, so I didn't submit a PR.

It does seem to me that the AssetElement should not return a value if the filename being passed in is blank.

Steps to reproduce

  1. Create a feed with an empty photo to import into a user element.
  2. Run import.

Additional info

  • Plugin version: 4.1.1
  • Craft version: 3.2.6
@alexmglover
Copy link
Author

I should probably clarify that the feed itself is what has the blank photo, and the import still sets a photo on the user element.

@vnali
Copy link
Contributor

vnali commented Aug 26, 2020

one workaround is checking for $value here like;
if ($value==''){
return null;
}
and it seems problem is here.
even if filename is empty, query returns an asset anyway.

vnali added a commit to vnali/feed-me that referenced this issue Feb 2, 2021
vnali added a commit to vnali/feed-me that referenced this issue Feb 2, 2021
@billymedia
Copy link

billymedia commented Jun 30, 2021

I am also encountering the same issue, users with no photos seem to find a random existing photo and save that against the user, the fix above worked but i would assume hacking the core file in this way isnt ideal. Any ideas @engram-design @angrybrad ?

@billymedia
Copy link

anyone?

@ryssbowh
Copy link

ryssbowh commented Dec 16, 2022

Same problem here on Feed me 5.0.4

@ryssbowh
Copy link

I'd really hoped this would have been fixed after the recent bunch of updates, but still happening.
Is there any update as for when this would be fixed ?

@angrybrad
Copy link
Member

Resolved in #1283 for the next v4 and v5 releases

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants