studio
studio copied to clipboard
Remove attachment metadata to fix missing thumbnails
- Related to https://github.com/Automattic/dotcom-forge/issues/8758
Proposed Changes
- Remove post_meta
_wp_attachment_metadatato remove intermediate images information and match existing image files. This is a temporal solution. The ideal solution would be updating php-wasm/node to at least 0.7.20 and using the PHP image editor. If the thumbnails are not fixed out of the box, then we could runwp media regenerate --yes.
Testing Instructions
- Run
STUDIO_IMPORT_EXPORT=true npm start - Click on Add site, and select this backup
- Click on Add site to start creating the site with the import
- Open the URL
/wp-admin/upload.phpin your browser - Observe all the images except one display the thumbnail. There is one that the original file is missing for some reason in the backup zip.
https://github.com/user-attachments/assets/9d9b5680-9694-433b-a9b7-1425343198ca
Pre-merge Checklist
- [ ] Have you checked for TypeScript, React or other console errors?
@sejas what is the source of the issue here? What is the content of _wp_attachment_metadata for such a broken thumbnail?
Closing this PR, I'll create a new PR that calls wp media regenerate --yes in the import process.