Problem/Motivation

In #3292287: Extend recipe runner to create content provided in the recipe's /content folder, we're adding a way to import content provided by a recipe. This is based on parts of the contributed Default Content module.

In review, @alexpott pointed out that, when importing file entities, the associated file is copied into the site's files directory. If there are duplicates, you end up with many copies of the same file. That sorta sucks.

Proposed resolution

Detect if we already have a particular file in the files directory, and don't import it if we do.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

phenaproxima created an issue. See original summary.

Wim Leers’s picture

Priority: Normal » Major

That sorta sucks.

This is IMHO a huge understatement.

This has the potential to make the media library/entity browser/site's content repository borderline unusable … (imagine the same thing is imported 100 times!).

I'm tempted to mark this a bug.

phenaproxima’s picture

Title: [PP-1] When importing file entities, check for duplicate files » When importing file entities, check for duplicate files
Status: Postponed » Active
Issue tags: +core-mvp

Blocker is in, so this needs work.

phenaproxima’s picture

Status: Active » Needs review

alexpott made their first commit to this issue’s fork.

alexpott’s picture

Status: Needs review » Reviewed & tested by the community

This looks great.

alexpott’s picture

Version: 11.x-dev » 10.3.x-dev
Status: Reviewed & tested by the community » Fixed

Committed and pushed 67ac9bc2f75 to 11.x and ec8a42f8b29 to 10.3.x. Thanks!

  • alexpott committed ec8a42f8 on 10.3.x
    Issue #3437068 by phenaproxima: When importing file entities, check for...

  • alexpott committed 67ac9bc2 on 11.x
    Issue #3437068 by phenaproxima: When importing file entities, check for...

  • c7cb8f54 committed on patch
    Update recipe 11.x patch 67ac9bc2 Issue #3437068 by phenaproxima: When...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.