When renaming objects in the Media Library,
s9y didn't check if a file with the same
name already exists, resulting in a file
name collision deleting both files from
the database _and_ from disk.
Add a check to avoid that.
An error message would be nice, too, but
that may be added later on.
Tested on s9y-stable test instance.
Cherry-picked from master branch.
Signed-off-by: Thomas Hochstein <thh@inter.net>
Initial motivation for this rework was to add support for the responsive thumbnnails (#474). But it also is a re-implementation instead of an enahncement of the existing code because the moveMediaDirectory function had grown into a mess. It was very hard to debug possible renaming bugs, like https://board.s9y.org/viewtopic.php?f=3&t=21185. This approach uses several small functions instead that can be combined and re-used.
Iconfont icons are of no value to screenreader users; in our case,
they get alternative text. By adding 'aria-hidden="true"' to the
<span> holding the iconfont icon, we avoid the screenreader trying
to announce the iconfont icon.
or change to echo with inner printf()
Before it broke like this:
`<span class="msg_notice"><span class="icon-info-circled"></span> <b>Größe von Vorsch.</span>
ändern</b>` which is wrong
Fixes many issues like for renaming files and subdir handling, database placements and other issues.
Structures case DIR, FILE and FILE vars for renaming, moving, select and replace.
Touches directoryEdit and mediaproperties related boundaries.
Adds better event messages, which fixes $ob_serendipity_moveMediaDirectory.
Extends and fixes media_items realname issues and changes the length of the item title to be as long as possible.
Added new constants to be executed to the lang files in near future, when some follow up commits have been added.
1st - case 'filedir' moving via image properties missed $renameValues['file'] array $pick
2cd - case 'file' moving mixed up rename() of thumbs completely
3rd - added new success message for case 'filedir' image properties move
4th - fixed markup for some more messages
Due to a regression in how these messages are emitted, these now
need to emit their msg markup in include/admin/images.inc.php or
include/functions_images.inc.php to avoid nested msg containers.
References #287