Review main Merged

20570[BUGFIX] Catch FolderDoesNotExist Exception on links/images

Alexander Opitz CR +2 V +2 Easy +15 −7 updated 01/06/19, 11:15

Commit message

If you have RTE content which have false links/images to files, we
get a FolderDoesNotExistException (FileDoesNotExistException in 6.0).
This should be catched.

Reproduce
* Create content element text
* In RTE change to text mode
* Add <img src="nofile" /> for image
or
* Add <a href="nowhere">link</a> for link
* save

Review

  • Code review CR +2
    • Philipp Gampe +2
    • Henrik Ziegenhain +1
    • Simon Schick +1
  • Verified V +2
    • Philipp Gampe +2
    • Henrik Ziegenhain +1
    • Simon Schick +1

Issues 1

Files 1

Review log 25

  1. Alexander Opitz uploaded patch set 2 05/25/13, 15:28

  2. Alexander Opitz uploaded patch set 3 05/25/13, 15:28

  3. Alexander Opitz commented on patch set 4 05/25/13, 15:28

    Hi Philipp, I tried it again and I get: TYPO3\CMS\Core\Resource\Exception\FolderDoesNotExistException thrown in file /home/opi/projects/typo3/typo3_src-git/typo3/sysext/core/Classes/Resource/ResourceStorage.php in line 1641. for inserting the img tag with not existing file. So can you take a look into: /home/opi/projects/typo3/typo3_src-git/typo3/sysext/core/Classes/Html/RteHtmlParser.php arounf line 00576 (on trunk): >>> 00574: // If the image is not magic and does not have a file uid, try to add the uid 00575: if (!$attribArray['data-htmlarea-file-uid'] && !$isMagicImage) { 00576: $fileOrFolderObject = $fileFactory->retrieveFileOrFolderObject($attribArray['src']); 00577: if ($fileOrFolderObject instanceof \TYPO3\CMS\Core\Resource\FileInterface) { 00578: $fileIdentifier = $fileOrFolderObject->getIdentifier(); <<< and tell me what value is given to the function call of "retrieveFileOrFolderObject"? Thanks.
  4. Alexander Opitz uploaded patch set 4 05/25/13, 15:28

  5. Alexander Opitz commented on patch set 4 05/25/13, 15:28

    I noted this in the commit message, that in 6.0.x releases a FileDoesNotExistException is thrown and not a FolderDoesNotExistException
  6. Alexander Opitz commented on patch set 4 05/25/13, 15:28

    You can change the Exception in the catch blog in that file to FileDoesNotExistException and try it with 6.0.x :-D
  7. Alexander Opitz uploaded patch set 5 05/25/13, 15:28

  8. Alexander Opitz commented on patch set 5 05/25/13, 15:28

    @Simon You are right, was a left over from changing the catch block. Fixed.
  9. Philipp Gampe commented on patch set 4 05/25/13, 15:28

    no exception for me ... just a nonbreaking space instead of the image and an RTE-error class for the missing link.
  10. Simon Schick commented on patch set 4 05/25/13, 15:28

    Fails; I would prefer that you didn't submit this Please look at line 798 in the patch ... looks like a duplicated line that does not belong there. I have a TYPO3 v6.1.0 patched with it without having this line and it works well.

    RteHtmlParser.php:798

    Isn't this the same as 2 lines above? I think this line should be dropped here.
  11. Simon Schick commented on patch set 5 05/25/13, 15:28

    Verified; Looks good to me, but someone else must approve
  12. Mr. Jenkins commented on patch set 1 05/25/13, 15:28

  13. Mr. Jenkins commented on patch set 2 05/25/13, 15:28

  14. Mr. Jenkins commented on patch set 2 05/25/13, 15:28

  15. Mr. Jenkins commented on patch set 2 05/25/13, 15:28

  16. Mr. Jenkins commented on patch set 2 05/25/13, 15:28

  17. Mr. Jenkins commented on patch set 3 05/25/13, 15:28

  18. Mr. Jenkins commented on patch set 4 05/25/13, 15:28

  19. Mr. Jenkins commented on patch set 5 05/25/13, 15:28

  20. Philipp Gampe commented on patch set 5 V 0 05/25/13, 15:28

    by team member; Looks good to me, approved
  21. Philipp Gampe merged patch set 6 05/25/13, 15:28

  22. Henrik Ziegenhain commented on patch set 4 01/06/19, 11:15

    Verified; Looks good to me, but someone else must approve
  23. Henrik Ziegenhain commented on patch set 4 01/06/19, 11:15

    Inserting the non existant image from the commit message leads to an exception. TYPO3\CMS\Core\Resource\Exception\FileDoesNotExistException thrown in file typo3_src-6.0.4/typo3/sysext/core/Classes/Resource/Driver/AbstractDriver.php in line 399.
  24. Henrik Ziegenhain commented on patch set 4 01/06/19, 11:15

    Oh... I`ve overread this. Sorry, but currently I have no 6.1 or 6.2 running to test this.
  25. Henrik Ziegenhain commented on patch set 5 01/06/19, 11:15

    Verified; Looks good to me, but someone else must approve