fix(7281): remove the string "DRAFT_MEDIA_FILES"#7432
Merged
martinjagodic merged 3 commits intodecaporg:mainfrom Aug 18, 2025
Merged
fix(7281): remove the string "DRAFT_MEDIA_FILES"#7432martinjagodic merged 3 commits intodecaporg:mainfrom
martinjagodic merged 3 commits intodecaporg:mainfrom
Conversation
|
This is currently blocking me. Would love to see it merged. 🙏🏻 |
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes #7281 by removing the unused "DRAFT_MEDIA_FILES" string constant from the media folder resolution logic. The key changes include:
- Removing the declaration of the "DRAFT_MEDIA_FILES" constant.
- Updating the logic in selectMediaFolder to no longer append "DRAFT_MEDIA_FILES" when entryPath is undefined.
- Adjusting corresponding tests to reflect the new behavior in media folder selection.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/decap-cms-core/src/reducers/entries.ts | Removed the "DRAFT_MEDIA_FILES" constant and updated fallback media folder logic to use solely the collection folder. |
| packages/decap-cms-core/src/reducers/tests/entries.spec.js | Updated test expectations to match the new behavior of selectMediaFolder. |
Comments suppressed due to low confidence (2)
packages/decap-cms-core/src/reducers/entries.ts:528
- Verify that removing the 'DRAFT_MEDIA_FILES' constant does not disrupt any legacy code paths or assumptions about the media folder structure.
const DRAFT_MEDIA_FILES = 'DRAFT_MEDIA_FILES';
packages/decap-cms-core/src/reducers/entries.ts:748
- Ensure that the updated fallback logic, which now returns only the collection folder, aligns with the overall design for media folder resolution.
: (collection!.get('folder') as string);
|
This is a blocker for me as well currently. Would love to see it merged! |
martinjagodic
approved these changes
Aug 18, 2025
martinjagodic
pushed a commit
to poslovnimediji/decap-cms
that referenced
this pull request
Sep 4, 2025
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.
Summary
This fixes #7281.
I simply removed the string
DRAFT_MEDIA_FILESfrom the return value ofselectMediaFolderand the issue disappeared.I have no idea why this string existed in the first place, but i highly advise that someone with more insight takes a look at this PR in case it breaks anything.
Test plan
I updated the corresponding test to reflect how i think this should work.
npm run testdoesn't show any failures.Checklist
Please add a
xinside each checkbox: