[BUGFIX] Adjust response usage for `file/exists` route 71/55371/2
authorAndreas Fernandez <a.fernandez@scripting-base.de>
Tue, 16 Jan 2018 11:21:06 +0000 (12:21 +0100)
committerBenni Mack <benni@typo3.org>
Tue, 16 Jan 2018 13:20:43 +0000 (14:20 +0100)
commitbce2a7584ba74931052120718e7f9cf4e16012e9
tree4aee83bf2ad8eb74c4400a3cbf26fbd6446c6372
parent98d866ca73c9db5af5ded3077d471609a3eb5869
[BUGFIX] Adjust response usage for `file/exists` route

With #83267 a JSON response object was introduced. The patch has the side
effect that any response is now an array but some usages in JavaScript
were not adjusted.

This patch does two things:

- `FileController::fileExistsInFolderAction()` does now either return an
  array for falsy results OR the file object.
- The JavaScript code is adjusted to check for a valid file object by
  requiring the `uid` property instead.

Resolves: #83568
Related: #83267
Releases: master
Change-Id: I9878f5f70b8af3ba8ec151a6ed514780547ec1ea
Reviewed-on: https://review.typo3.org/55371
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Frank Naegler <frank.naegler@typo3.org>
Reviewed-by: Frans Saris <franssaris@gmail.com>
Tested-by: Frank Naegler <frank.naegler@typo3.org>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
typo3/sysext/backend/Classes/Controller/File/FileController.php
typo3/sysext/backend/Resources/Private/TypeScript/RenameFile.ts
typo3/sysext/backend/Resources/Public/JavaScript/DragUploader.js
typo3/sysext/backend/Resources/Public/JavaScript/RenameFile.js