Bug #87162
closedWidth and Height in translated meta data records not updated, when original file is replaced
100%
Description
Width and height of an image is stored in meta data records.
These properties are extracted by FAL API when a new image is uploaded.
When meta data is localized, DataHandler should take care to update these properties in localized record (see https://forge.typo3.org/issues/81096)
Given a localized meta data record is created exists for a file
When the image is replaced using the file list
I would expect that width and height is updated in all meta data records according to the new image
What actually happens, is that only the meta data record with sys_language_uid = 0 is updated
Updated by Helmut Hummel almost 6 years ago
- Related to Bug #81096: Images wrongly cropped in translated pages added
Updated by André Buchmann over 5 years ago
This behaviour is the same in TYPO3 9.5
If you have a bunch of replaced images and need to fix the data you could use this statement. It searches for differences in width and height fields between translation and parent record and updates the translation fields with the value of the l10n_parent.
UPDATE `sys_file_metadata` AS `dest`,
(
SELECT `translation`.`uid`, `translation`.`l10n_parent`, `translation`.`width`, `translation`.`height`, `parent`.`width` AS `parent_width`, `parent`.`height` AS `parent_height`
FROM `sys_file_metadata` `translation`
INNER JOIN `sys_file_metadata` `parent` ON `translation`.`l10n_parent` = `parent`.`uid`
WHERE (`translation`.`width` <> `parent`.`width`) OR (`translation`.`height` <> `parent`.`height`)
) AS `src`
SET `dest`.`width` = `src`.`parent_width`, `dest`.`height` = `src`.`parent_height`
WHERE `dest`.`uid` = `src`.`uid`
Updated by André Buchmann about 3 years ago
I tried to fix it for TYPO3 11. The Problem here is the use of the MetaDataAspect in the FAL Indexer. The MetadataRepository and the MetadataAspect constructed for only one single language.
Here the metadata update is made during the replace: https://github.com/TYPO3/typo3/blob/master/typo3/sysext/core/Classes/Resource/Index/Indexer.php#L112
One solution could be to implement an PSR-14 event on "AfterFileMetaDataUpdatedEvent" and update each translation. But I think the aspect needs to support multiple languages as this is the reason why TYPO3 is better than other CMS ;-)
Updated by Gerrit Code Review about 3 years ago
- Status changed from New to Under Review
Patch set 1 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/+/72044
Updated by Gerrit Code Review about 3 years ago
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/+/72044
Updated by André Buchmann about 3 years ago
For now I created an PSR-14 EventListener which fixes this issue for TYPO3 10 & 11. I think it's currently the easiest way to do this, but not the most beautiful.
IMHO the MetaDataAspect and MetaDataRepository need to support multiple languages in future versions of TYPO3. This might be a breaking change.
Updated by Gerrit Code Review about 3 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/c/Packages/TYPO3.CMS/+/72044
Updated by Gerrit Code Review about 3 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/c/Packages/TYPO3.CMS/+/72044
Updated by Gerrit Code Review about 3 years ago
Patch set 5 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/+/72044
Updated by Gerrit Code Review about 3 years ago
Patch set 6 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/+/72044
Updated by Gerrit Code Review about 3 years ago
Patch set 1 for branch 10.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/71925
Updated by André Buchmann about 3 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 685b64b31d4edad5d8ddeee62f945e9c9368bde8.
Updated by Gerrit Code Review about 3 years ago
- Status changed from Resolved to Under Review
Patch set 2 for branch 10.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/71925
Updated by Gerrit Code Review about 3 years ago
Patch set 3 for branch 10.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/71925
Updated by Gerrit Code Review about 3 years ago
Patch set 4 for branch 10.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/71925
Updated by André Buchmann about 3 years ago
- Status changed from Under Review to Resolved
Applied in changeset 04cd3f0a5b48fbc56403fc8b7d59cd725e92b122.
Updated by Christian Kuhn almost 3 years ago
- Related to Bug #96369: Call to undefined method added
Updated by Oliver Hader almost 3 years ago
- Related to Bug #96382: Error when renaming a file in TYPO3 10.4.22 added