Project

General

Profile

Actions

Bug #87162

closed

Width and Height in translated meta data records not updated, when original file is replaced

Added by Helmut Hummel almost 6 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
File Abstraction Layer (FAL)
Target version:
-
Start date:
2018-12-14
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
8
PHP Version:
Tags:
metadata, languages
Complexity:
Is Regression:
Sprint Focus:

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


Related issues 3 (1 open2 closed)

Related to TYPO3 Core - Bug #81096: Images wrongly cropped in translated pagesAccepted2017-05-01

Actions
Related to TYPO3 Core - Bug #96369: Call to undefined methodClosed2021-12-16

Actions
Related to TYPO3 Core - Bug #96382: Error when renaming a file in TYPO3 10.4.22Closed2021-12-17

Actions
Actions #1

Updated by Helmut Hummel almost 6 years ago

  • Related to Bug #81096: Images wrongly cropped in translated pages added
Actions #2

Updated by Susanne Moog over 5 years ago

  • Tags set to metadata, languages
Actions #3

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`
Actions #4

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 ;-)

Actions #5

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

Actions #6

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

Actions #7

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.

Actions #8

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

Actions #9

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

Actions #10

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

Actions #11

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

Actions #12

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

Actions #13

Updated by André Buchmann about 3 years ago

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

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

Actions #15

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

Actions #16

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

Actions #17

Updated by André Buchmann about 3 years ago

  • Status changed from Under Review to Resolved
Actions #18

Updated by Christian Kuhn almost 3 years ago

  • Related to Bug #96369: Call to undefined method added
Actions #19

Updated by Oliver Hader almost 3 years ago

  • Related to Bug #96382: Error when renaming a file in TYPO3 10.4.22 added
Actions #20

Updated by Benni Mack about 2 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF