Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix existing asset detection #73

Merged
merged 3 commits into from
Jan 7, 2025
Merged

Conversation

carstenjaksch
Copy link
Contributor

The folder setting of file fields does not work as expected.

Let's have a look at some example configuration:

Asset URL: https://www.domain.tld/wp-content/uploads/2024/08/image.jpg
Base URL: https://www.domain.tld/wp-content/uploads/
Folder: images

The asset is uploaded correctly to the configured folder images instead of 2024/08. However, the check for an existent asset to prevent multiple uploads does not take the new folder into account.

Therefore, the assets will get uploaded again with a timestamp at the end on every new import run.

This PR solves the issue in a not so elegant way I believe. It works, but maybe someone could refactor it.

carstenjaksch and others added 3 commits January 5, 2025 11:51
Correctly detect existing assets if a folder is configured.
@duncanmcclean duncanmcclean merged commit af6a249 into statamic:main Jan 7, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants