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

Images failing to be assigned when re-running a feed - 'Trying to get property 'id' of non-object' #747

Closed
Decipher-Webmaster opened this issue Sep 15, 2020 · 1 comment
Labels

Comments

@Decipher-Webmaster
Copy link

Decipher-Webmaster commented Sep 15, 2020

Description

I have a site which has multiple feeds importing from a JSON API. We run a cron job on these feeds which are set to 'update', 'delete' and 'create' elements. When a feed is run for the first time, assets are created from asset URL's and the feed will run successfully.

However, when the feed gets re-run all matched entries with existing assets encounter the following anonymised logs and errors.


Info - News - Example Site - Featured Articles: Fetching remote image https://example-site.com/Heroes/Heroes/example-asset.png - example-asset.png

Info - News - Example Site - Featured Articles: Creating asset with content {"tempFilePath":"/Users/example/htdocs/Example-Site/storage/runtime/temp/feedme/example-asset.png","filename":"example-asset.png","newFolderId":"51","volumeId":"11","avoidFilenameConflicts":true,"scenario":"create","conflict":"replace"}

Error - News - Example Site - Featured Articles: newsHeroImageWitt - Asset error: https://example-site.com/Heroes/Heroes/example-asset.png - Trying to get property 'id' of non-object.


This results in duplicate assets being created every time the feed is run and the actual asset now isn't assigned in the entry. It seem this particular issue has been raised before but not fixed so we'd be really grateful if it could be addressed.

Steps to reproduce

  1. Run a feed that imports an asset from a URL, creates an asset from it, and saves to an asset field.
  2. Re-run the feed, errors get logged, duplicate assets created, and the asset fails to get assigned in the entry.

Additional info

  • Craft version: 3.5.8
  • PHP version: 7.3.1
  • Database driver & version: MySQL 5.7
  • Plugins & versions: FeedMe 4.2.3
@stefaniko92
Copy link

I have some problems... Keep both option solve the issue but duplicate assets in storage

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

2 participants