Repository navigation
fix: normalize Magento category media paths - #65
Merged
Dennis Garding (DennisGarding) merged 6 commits intoAug 12, 2026
Merged
Conversation
Dennis Garding (DennisGarding)
requested a review
from Lars Kemper (larskemper)
August 11, 2026 11:04
Jozsef Damokos (jozsefdamokos)
approved these changes
Aug 11, 2026
Lars Kemper (larskemper)
approved these changes
Aug 12, 2026
Dennis Garding (DennisGarding)
deleted the
18903/fix-category-media-url
branch
August 12, 2026 08:59
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes: shopware/shopware#18903
1. Why is this change necessary?
Magento category image values can already contain the
/media/catalog/category/prefix. The Migration Assistant currently prepends this prefix unconditionally, resulting in invalid paths such as:/media/catalog/category//media/catalog/category/example.jpgAs a result, category images cannot be downloaded during migration.
2. What does this change do, exactly?
Category media paths are normalized before creating the migration media-file URI.
The prefix is added only when it is missing, and leading slashes are normalized so that all supported input formats produce a canonical URI:
/media/catalog/category/example.jpgA regression test covers bare filenames as well as paths with and without a leading slash.