Problem/Motivation

Each time a new media entity is saved to Media Directories using a directory-based file URL, a redirect is automatically created. This behaviour may lead to unnecessary redirects being generated, potentially causing issues such as cluttered redirect management, performance overhead, or unintended URL conflicts.

Steps to reproduce

1. Install Media Directories module
2. Go to document media type and edit the Document field.
3. Set the following token in File path field [media:directory:entity:parents]/[media:directory:entity:name]
4. Save the changes.
5. Create a media document .
6 You will a redirect get added from Temporary location to Media directory location.

CommentFileSizeAuthor
Screenshot 2024-12-16 at 6.50.29 PM.png191.37 KBsakshi@17
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:

Comments

sakshi@17 created an issue. See original summary.

sakshi@17’s picture

Title: Redirect gets created every time new media entity is save » Redirect gets created every time new media entity is created.

voleger’s picture

Status: Active » Needs work
Issue tags: +Needs tests

It needs work for test coverage based on the steps to reproduce.