* put a file without a generated preview in the trashbin
(e.g. a *.docx file)
* open the trashbin
* following errors will show up in the nextcloud.log:
- filesize(): stat failed for ...
- fopen(...): failed to open stream: No such file or directory at ...
- fread() expects parameter 1 to be resource, boolean given at ...
- fclose() expects parameter 1 to be resource, boolean given at ...
- imagecreatefromstring(): Empty string or invalid image at ...
This is because the preview code tries to load an SVG image, which
is obviously only text.
The fix simply handles this before the loading happens and the web UI
keeps showing the default mimetype icon.
This enforces proper types on POST and GET arguments where I considered it sensible. I didn't update some as I don't know what kind of values they would support 🙈
Fixes https://github.com/owncloud/core/issues/14196 for core
Files app:
- removed file list template, now rendering list from JSON response
- FileList.addFile/addDir is now FileList.add() and takes a JS map with all required
arguments instead of having a long number of function arguments
- added unit tests for many FileList operations
- fixed newfile.php, newfolder.php and rename.php to return the file's
full JSON on success
- removed obsolete/unused undo code
- removed download_url / loading options, now using
Files.getDownloadUrl() for that
- server side now uses Helper::getFileInfo() to prepare file JSON response
- previews are now client-side only
Breadcrumbs are now JS only:
- Added BreadCrumb class to handle breadcrumb rendering and events
- Added unit test for BreadCrumb class
- Moved all relevant JS functions to the BreadCrumb class
Public page now uses ajax to load the file list:
- Added Helper class in sharing app to make it easier to authenticate
and retrieve the file's real path
- Added ajax/list.php to retrieve the file list
- Fixed FileActions and FileList to work with the ajax list
Core:
- Fixed file picker dialog to use the same list format as files app
- Fixed "delete" and "restore" actions to not send the file list when
all files are selected
- When some files are selected, sends the current dir
- Removed "dirListing" attribute as the backend is able to compute the
value based on the current dir
To prevent having to send the list of all files for deletion, only set a
flag "allfiles". This should make it a bit smoother when deleting 5000+
files.
Also fixes some "empty trash" message issues.
Frontend:
- The files app list now uses ajax calls to refresh the list.
- Added support the browser back button (history API).
- Added mask + spinner while loading file list
Backend:
- Added utility function in core JS for parsing query strings.
- Moved file list + breadcrumb template data code to helper
functions
- Fixed some file paths in trashbin app to be similar to the files app