Quantcast
Channel: How do I automatically add a title to imported entities? - Drupal Answers
Viewing all articles
Browse latest Browse all 4

How do I automatically add a title to imported entities?

$
0
0

I have a site with a lot of audio files (using core's Media audio media type).

On the Manage form display admin page (/admin/structure/media/manage/audio/form-fields), I have set the Name field to Disabled.

This way, when I add a media audio entity in the UI (at /media/add/audio), then I don't have to add the title, and the entity name will automatically be set to the file name.

Now I want to automate media audio entity creation with the Feeds module. I configured a feed type + a feed for my media audio entities. I'm importing CSV files from a directory.

I used the following mappings:

  • File ID + File Description for the media field field_media_audio_file
  • Code for the text field field_import_id (for which I set the unique option to keep track of imports)

However, when I try to import the feed, I get this error:

Name (name): This value should not be null.

How can I disable this validation (checking for the Name field) by the Feeds module for media audio entities?

As a workaround, I can create a column in the CSV file and list all the file names, but this results in duplicate information and presents the risk of typos.


Viewing all articles
Browse latest Browse all 4

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>