Please update instructions

Created on 29 May 2025, about 1 month ago

Problem/Motivation

Hi, I was running into a weird issue where items are being imported, but there's some kind of duplication happening and then the wrong entity is being assigned to the main content node being created (described at the bottom). I wanted to see if the instructions in the Readme and the module page could be updated to be made more clear so that other users don't run into the same issue I did.

Proposed new instructions:

  1. Requires: Feeds, Feeds Tamper
  2. Create your entity and its fields. One field should be a media reference field, the one you want to import into.
  3. Create a Feed Type.
  4. Under the Mapping tab
    • in the Select a Target dropdown, choose your media reference field.
    • Then under the Select a Source dropdown, choose "New CSV column source" and write in the header for that CSV column (or your other source that will provide URLs to the media you will be importing.)
    • Then click the Save button at the bottom of the page.
    • Next, click the gear icon and select the Reference By: ID option.
    • Then click the Update button.
    • DO NOT use Reference By: Name, this creates duplicate entities and half of them are broken.
  5. Go to the Tamper tab for the feed.
  6. Find the media field and click the Add Plugin link. Choose the Create Media Tamper option (should be in the Other category).
  7. In the plugin settings,
    • Set the label field to something descriptive if it isn't already filled in.
    • Choose the type of Media you want the new entities created into in the Select Media Types dropdown
    • For the Whats the media field?, go to Structure > Media Types, find the media type you want your files inserted into and choose Manage Fields for that type. Then copy the machine name of the image or file field and paste the machine name in the Whats the media field? field.
  8. Finish setting up the rest of the fields for you feed as you normally would.
  9. Create a feed under Content > Feeds and import your new content.
    If the URL of the file you want to import is publicly accessible on the internet, this module will check if the file already exists in the file system:
    • If it doesn't exist, this module creates the new file entity and media.
    • If it already exists, this module will associate the existing media to the content being imported.
    • If the file isn't publicly accessible, the module cannot import the file.

NOTE: This plugin does work with the S3FS module for anyone using S3 to store/serve their files.

Proposed resolution

In addition to updating the instructions with the above, please create an error handler in the code for when someone chooses something other than Reference by: ID on the mapping page. Choosing Reference by: Name does create the new media entities, but it also creates additional entities with no media attached and the file name is the ID of the correctly created media entities. (screenshot attached) The bad entities are the ones that get associated with the new nodes created and so you think that the media entities weren't created or something else went wrong. When you then look at the Media page, you find out you've created 2x as many media entities as you need and only half of them actually contain the files you're looking for.

In the screenshot, 3633 refers to the ID for the 100most.png image, whose media URL is /media/3633/edit
3634 refers to images_large_...
3631 refers to savestaffing.png
3632 refers to joel_bissell_mlive.jpg

πŸ› Bug report
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States rex.barkdoll

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024