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
Admin v1.10.0-rc.8 – Media upload: onAdminAfterAddMedia? #1867
Comments
Regarding to why temporary location is being used: Using temporary files before saving has multiple benefits, including that you can upload files on new pages and that your pages won't be broken while you are modifying them. This means that frontend will not change until you hit save. This also means that all the media will be added/removed at once during the save. I need to check if |
Thank you! So I wasn’t completely wrong about this being a feature to make upload for new pages available – only it isn’t yet working but probably in the final release. The other reason – not breaking pages while still editing them – also makes sense, I guess :) So I’m excited to see how I can make my plugin work properly again. |
I've now reverted the behavior of the We may need to figure out how to add more metadata to the updated files, I think it should happen when you're uploading the file...? |
Thanks, that sounds like good news to me :)
I don’t quite know what that means. But I’ll check once the next release is out.
I’m not sure here either what you mean, I’m sorry. My plugin now creates the metadata file when you save data for the first time using the provided modal. Later on, the metadata will be overwritten by saving the form. There’s no creating an empty metadata file anymore, also because this got in the way with the automated EXIF data writing as provided by the core (setting |
Let's try out if everything works with this fix. If there are more issues, please just create a new issue about it. |
My Admin Addon Media Metadata Plugin is making use of the event hook
onAdminAfterAddMedia
to create a[mediafile].meta.yaml
file for each newly uploaded media file with empty values for title, alt, and caption.In Admin v1.10.0-rc.8 that doesn’t work anymore since files are being stored in a tmp folder and moved to the page folder only on saving the page.
onAdminAfterAddMedia
still being fired? If not, what’s the alternative?See also the issue Limited functionality in Admin Plugin v1.10.0-rc.8 in my plugin’s repository: clivebeckett/grav-plugin-admin-addon-media-metadata#7
The text was updated successfully, but these errors were encountered: