Bug #77866

Link to file in RTE does not prevent deleting this file in the File List

Added by Patrick Broens over 2 years ago. Updated 4 months ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
File Abstraction Layer (FAL)
Target version:
-
Start date:
2016-09-06
Due date:
% Done:

0%

TYPO3 Version:
7
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

Normally when an image (or other file) in the file list has a reference, it cannot be deleted without deleting the reference. It first will ask you if you want to delete it with the amount of references and after clicking "Ok" you will get an error message that the file cannot be deleted:

File not deleted
The file cannot be deleted since it is still used at the following places: [record:pages:11], [record:pages:12]

This behaviour is fine.

However, when you make a link to a file in the RTE, and try to delete it in the file list, it will also tell you there is a reference and asking you if you want to continue, but when clicking "Ok", the file is deleted without the error message.

Is this behaviour intended, or should it work like other references?


Related issues

Related to TYPO3 Core - Bug #82864: File links in rte_ckeditor don't get counted as a reference Closed 2017-10-26

History

#1 Updated by Patrick Broens over 2 years ago

The RTE I'm mentioning is the one in CE "Text & Media".

#2 Updated by Frans Saris over 2 years ago

The sys_ref record linking file to CE field is present?

#3 Updated by Patrick Broens about 2 years ago

Yes, the reference is present is sys_refindex as softref "typolink_tag".

To reproduce:
  • Make a CE "Text and Media"
  • In the RTE make a link to a file which does not have any references (upload one)
  • Go to the file list
  • Delete the file

The file is deleted without error.

#4 Updated by Riccardo De Contardi about 1 year ago

  • Related to Bug #82864: File links in rte_ckeditor don't get counted as a reference added

#5 Updated by Riccardo De Contardi 5 months ago

  • Status changed from New to Closed

We're sorry to close this one, but the insert image functionality only concerns HTMLArea, that is no longer supported by TYPO3. (or can be re-added to rte_ckeditor using a third-party extension like https://extensions.typo3.org/extension/rte_ckeditor_image/ )

You can open up new issues here https://github.com/FriendsOfTYPO3/rtehtmlarea.
If you think that this is the wrong decision please reopen it or ping me and I'll do.

Thank you

#6 Updated by Tobias Wollender 4 months ago

I just stumbled over the same problem (in 7.6 and 8.7). Patrick isn't talking about inserting an image in the rte, but just linking to it (could also be a pdf file for instance). If you do that, the file will show a reference in the file list, just as it would if you add it in an explicit media field. But when you just have a reference from a link, the file can be deleted. If it's a reference from a media field, deleting of the file isn't allowed. Doesn't matter for me if it's a 7.6 or 8.7 installation or if using htmlarea or the new ckeditor. I think it shouldn't be allowed to delete a file when it has a reference - no matter where the reference comes from. So I think this issue should be reopened.

#7 Updated by Mathias Brodala 4 months ago

I cannot confirm the issue. As soon as I create a link to a file in RTE, the reference counter for the file is increased and I get the usual Are you sure you want to delete '...'? (There are 1 reference(s) to this file!) confirmation when I try to delete it. Do you mean something else?

#8 Updated by Tobias Wollender 4 months ago

For me the reference count is also increased when linking to a file in the RTE and I too see this confirmation dialog. But when I click "delete" in this dialog, the file is actually deleted. This shouldn't happen in this case, because there is a reference to it. Did you try to delete it in the end? Or did you stop on the dialog? (Just curious).

#9 Updated by Riccardo De Contardi 4 months ago

  • Subject changed from Link to image in RTE does not prevent deleting this image in the File List to Link to file in RTE does not prevent deleting this file in the File List

I see three different behaviors/potential issues from the tests I have performed under 9.4-dev (latest master)

Basic

- create a page
- upload a file/image on filelist

Scenario #1

- create a content element (type = TEXT)
- write some text (e.g. "link to image")
- mark the text and add a link, choose as link the file/image
- media module
- attempt to delete the file

Results:

the modal window tells you that there is a reference to the file, but you can continue and delete it anyway and the file is actually deleted

Scenario #2

- create a content element (type = TEXT and IMAGE)
- add the uploaded file/image in the "Images tab"
- media module
- attempt to delete the file

Results:

the modal window tells you that there is a reference to the file; if you choose to continue and delete it anyway, but the file is still there.
an alert message tells you what happened:

File not deleted
The file cannot be deleted since it is still used at the following places [record:tt_content:905]

Maybe it should be better to disable the delete button at all, it has little sense to let the user continue an action and afterwards tell him/her that it was not allowed to do that :)

Scenario #3

- create a content element (type = TEXT)
- add a Header
- use "Link" to link the header to the file/image
- media module
- attempt to delete the file

Results:

the file can be deleted; the link is not counted as a reference (!) I don't know if there is already an issue about that.

#10 Updated by Riccardo De Contardi 4 months ago

  • Status changed from Closed to New

Also available in: Atom PDF