Bug #84563
closedDefault file properties in sys_file_reference ignored
100%
Description
When a file reference is added without setting any properties and file original file properties are updated after that, the reference does not use them.
Steps to reproduce:
- Upload an image to fileadmin
- Create a file reference for that image in a content element without adding any data
- Update some file property, that could be overwritten in the reference (e.g alternative text)
- Check the frontend rendering of that image
Expected result:
The newly entered alternative text should be used for that reference because no other text was entered in the reference.
Current result:
There will ne no alternative text for that image.
The problem is, that there is an empty string written into the sys_file_reference table by default when adding a file without the property set. But TYPO3 needs this field to be NULL to use the default as override.
Possible solution:
When adding a reference for a file, check if the overridable fields for that image are empty. If so, set the sys_file_reference column to NULL instead of an empty string.
Updated by Frans Saris over 6 years ago
This should already be the case.
Did you use the default core content elements?
Do you have the override checkboxes when editing the sys_file_reference?
Updated by Tim Schreiner over 6 years ago
Frans Saris wrote:
This should already be the case.
Did you use the default core content elements?
Do you have the override checkboxes when editing the sys_file_reference?
I have tested it on the current master with the default Text & Media content element.
The problem is, that when no default value exists, but placeholder is defined in TCA and empty, the checkbox get automatically checked. So the record will not use the default value, even if it is set afterwards.
I got a fix for that. After that fix, the editor has to opt-in the the checkbox, if he wants to override the value. Will pushing it to gerrit soon for further discussion.
Updated by Gerrit Code Review over 6 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/56486
Updated by Tymoteusz Motylewski over 6 years ago
- Related to Bug #81235: Image metadata (description) isn´t shown in content element added
Updated by Gerrit Code Review over 6 years ago
Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56486
Updated by Gerrit Code Review over 6 years ago
Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56486
Updated by Gerrit Code Review over 6 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/56989
Updated by Tim Schreiner over 6 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 833cbc6001cc5e7db2f220a61ee0333af7a1a2dc.