This is a static dump of issues in the old "Flyspray" bugtracker for DokuWiki. Bugs and feature requests
are now tracked at the issue tracker at Github.
Closed
Won't implement
FS#1566 Add MEDIA_CREATE_FILE and MEDIA_MODIFY_FILE events
Customization
2009-01-15jaredm
Currently the only way for plugins to interact with media file events is on file upload or file deletion. However, one can imagine many cases where plugins would want to create media files without having them be uploaded first, or modify existing files. And that means that other plugins will want to know when these important events occur.
Thus I propose these two new events to handle non-uploaded media creation and modification. They could also possibly be combined into a single event (MEDIA_MODIFY_FILE?), with event data indicating whether the file was created or modified.
Some possible uses of this: creating thumbnails or watermarking existing images, copying/moving media files to different namespaces, and really any automated processing of media files in general.
2014-03-13ChrisS
I think you're describing a nomenclature issue only.
MEDIA_UPLOAD_FINISH is upload independent - one of its parameters is the path to the new media file and another the function to be used to move it. Its possible to set those for a non-uploaded file. For now, DokuWiki pretty well treats media files as immutable (only jpeg metadata can be altered), this event handles both new media (your CREATE) & replacing existing media (your MODIFY) via the event's overwrite parameter.
In its present form, MEDIA_UPLOAD_FINISH can currently be used for the uses you outline.
If a plugin creates a media file, it would ideally call media_save(), which in turn will trigger the MEDIA_UPLOAD_FINISH event.