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

Cache Not Cleared in wp_mcloud_post_map When Deleting Files #243

Open
BoatsDawn opened this issue Jan 23, 2025 · 0 comments · May be fixed by #244
Open

Cache Not Cleared in wp_mcloud_post_map When Deleting Files #243

BoatsDawn opened this issue Jan 23, 2025 · 0 comments · May be fixed by #244

Comments

@BoatsDawn
Copy link

Describe the Bug

When the Cache Attachment Lookups setting is enabled, deleting a file does not remove its cache entry from the wp_mcloud_post_map table. This leads to issues when re-uploading a file with the same name, as the cache still points to the old file instead of the new one.

Steps to Reproduce

  1. Upload a file named test.zip.
  2. Delete the file test.zip.
  3. Re-upload a file with the same name, test.zip.
  4. Use attachment_url_to_postid($url) to check the association — it still points to the file from step 1.

Expected Behavior

When a file is deleted, its corresponding entry in the wp_mcloud_post_map table should also be deleted to prevent stale cache data.

Server Details

  • Operating System: Ubuntu (Docker)
  • PHP Version: 8.2
  • Web Server: Apache (from the WordPress Docker image)

Plugin Installation

Installed via the WordPress admin panel using the plugin store.

@BoatsDawn BoatsDawn linked a pull request Jan 23, 2025 that will close this issue
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 a pull request may close this issue.

1 participant