Incorrect image URL after media import using Media Library Import

Created on 18 September 2024, 3 months ago

Problem/Motivation

When using the Media Library Import module in Drupal 10.3.1 to import media files, the URLs of the imported images are incorrect. The issue occurs when the media is added to the Drupal system. The paths contain extra directory layers and query parameters, causing the images to break.

For example:

Correct Path: http://localhost:8080/Drupal_migration/web/sites/default/files/lancaster...
Generated Path: http://localhost:8080/Drupal_migration/web/sites/default/files/styles/me...
This seems to be an issue with the way URLs are generated for media using the image styles and tokenization, which could be a misconfiguration or a bug.

Steps to reproduce

1. Set up Drupal 10 and install the Media Library Import module.
2. Upload a folder with media files, ensuring subdirectories exist.
3. Check the paths of the uploaded images.
4. Notice that the URLs are incorrect and lead to broken images.

Proposed resolution

Investigate the URL generation for media files. The system might be automatically applying image styles or manipulating the file path incorrectly.

Possible resolutions could include:

- Adjusting the settings for image styles.
- Ensuring correct configuration for public file paths in settings.php.
- Investigating whether the styles folder is being unnecessarily added to the URL.

Remaining tasks

- Test the issue on a fresh Drupal installation.
- Verify if any configurations or patches can resolve the problem.
- Submit logs or additional debugging information if needed.

User interface changes

No direct UI changes expected, but users may encounter broken images in the media library or on the front-end.

API changes

None expected.

Data model changes

No data model changes expected.

🐛 Bug report
Status

Active

Version

2.0

Component

Code

Created by

🇮🇳India rahul-kumar-07

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

Comments & Activities

Production build 0.71.5 2024