Project

General

Profile

Actions

Bug #77866

closed

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

Added by Patrick Broens over 7 years ago. Updated over 4 years ago.

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

100%

Estimated time:
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 2 (0 open2 closed)

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

Actions
Related to TYPO3 Core - Bug #88462: If a file is referenced in content elements, it can be deleted without warningsClosed2019-05-30

Actions
Actions #1

Updated by Patrick Broens over 7 years ago

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

Actions #2

Updated by Frans Saris over 7 years ago

The sys_ref record linking file to CE field is present?

Actions #3

Updated by Patrick Broens over 7 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.

Actions #4

Updated by Riccardo De Contardi over 6 years ago

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

Updated by Riccardo De Contardi almost 6 years 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

Actions #6

Updated by Tobias Wollender over 5 years 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.

Actions #7

Updated by Mathias Brodala over 5 years 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?

Actions #8

Updated by Tobias Wollender over 5 years 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).

Actions #9

Updated by Riccardo De Contardi over 5 years 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.

Actions #10

Updated by Riccardo De Contardi over 5 years ago

  • Status changed from Closed to New
Actions #11

Updated by Gerrit Code Review almost 5 years ago

  • Status changed from New to Under Review

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60846

Actions #12

Updated by Dmitry Dulepov almost 5 years ago

  • Related to Bug #88462: If a file is referenced in content elements, it can be deleted without warnings added
Actions #13

Updated by Dieter Porth almost 5 years ago

The Scenario 3 in #9 is not solved.

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.

If you try the senario above in TYPO3 9, the table sys_refindex won't be filled. The patch will not work for that scenario.

Add.
You can't currently save a link in TYPO3 10, if the column has the Type inputLink.

Actions #14

Updated by Dieter Porth almost 5 years ago

Not Workiung
1. You open a Content-Element with empty header_link-field.
2. You use the Link-editor and add an link to the field.
3. You click on Save-Button
=> the link will not added.
Working
1. You open a Content-Element with empty header_link-field.
2. You use the Link-editor and add an link to the field.
3. You click into the inputfield and leave it.
4. You click on Save-Button
=> the link will be changed.

It seems to me, that the hidden-class cause some trouble, which is defined in Build/Sources/TypeScript/backend/Resources/Public/TypeScript/FormEngine/Element/InputLinkElement.ts.

Actions #15

Updated by Dmitry Dulepov almost 5 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #16

Updated by Gerrit Code Review over 4 years ago

  • Status changed from Resolved to Under Review

Patch set 1 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61534

Actions #17

Updated by Gerrit Code Review over 4 years ago

Patch set 1 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61535

Actions #18

Updated by Dmitry Dulepov over 4 years ago

  • Status changed from Under Review to Resolved
Actions #19

Updated by Benni Mack over 4 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF