Bug #56882

Can not translate IRRE elements

Added by Tymoteusz Motylewski over 5 years ago. Updated about 1 year ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
FormEngine aka TCEforms
Target version:
-
Start date:
2014-03-13
Due date:
% Done:

100%

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

Description

Translation of irre elements is buggy.
Scenario 1
IRRE tutorial is installed
- create new CE,
- go to "IRRE" tab
- create new irre element
- save

localize this element to other language
=> CE is localized, but irre elements are not

Scenario2
Create plugin with FAL field in flexform
- create CE of this plugin
- add images to the FAL field
- save
- translate this element
=> images are localized, but an additional row i shown on the list of images
When testing scenario 2 with flv files instead of images, no records were correctly localized

scenaroo1-1.png View (48.6 KB) Tymoteusz Motylewski, 2014-03-13 18:30

scenario1-2.png View (54.2 KB) Tymoteusz Motylewski, 2014-03-13 18:30

test_case_1.png View (84.2 KB) Oliver Hader, 2014-03-18 10:29

scenario1_newIrre_tutorial.png View (103 KB) Tymoteusz Motylewski, 2014-03-18 12:17

scenario1_newirre2.png View (100 KB) Tymoteusz Motylewski, 2014-03-18 12:17

scenario2_mediacenter.png View (75.7 KB) Tymoteusz Motylewski, 2014-03-18 12:47

scenario2_B_mediacenter.png View (97.5 KB) Tymoteusz Motylewski, 2014-03-18 12:47

mediacenter.zip (18.1 KB) Tymoteusz Motylewski, 2014-03-18 12:47

scenario2_A_exception.png View (201 KB) Tymoteusz Motylewski, 2014-03-18 12:49

scenario2_new.png View (142 KB) Tymoteusz Motylewski, 2014-07-30 11:44


Related issues

Related to TYPO3 Core - Bug #58951: show_item does not properly resolve MM group items Closed 2014-05-20
Related to TYPO3 Core - Bug #59664: Copied flexform element is missing FAL images Closed 2014-06-19
Related to TYPO3 Core - Bug #59734: Translating a CE containing inline elements doesn't apply language to inline elements Under Review 2014-06-20
Related to TYPO3 Core - Bug #58306: Copy bug with inline records in flexforms Closed 2014-04-29
Duplicated by TYPO3 Core - Bug #58554: Can not translate flexform FAL elements in Typo3 6.2.1 Closed 2014-05-06

Associated revisions

Revision 5ee67bca (diff)
Added by Daniel Alder about 5 years ago

[BUGFIX] Show correct number of inline records defined in flexform

getRelatedRecordsArray() is expecting comma separated list of record ids
Before this patch the full flexform xml was passed.
Now we detect whether a field is a flexform and try to extract the
correct field values from it.

Resolves: #56882
Releases: master, 6.2
Change-Id: I50db5dfd5f07bbc20e369c0a07f2f294afb85321
Reviewed-on: http://review.typo3.org/32986
Reviewed-by: Markus Klein <>
Reviewed-by: Daniel Alder <>
Tested-by: Daniel Alder <>
Reviewed-by: Wouter Wolters <>
Tested-by: Wouter Wolters <>
Reviewed-by: Stefan Neufeind <>
Reviewed-by: Anja Leichsenring <>
Tested-by: Anja Leichsenring <>

Revision 87eaea0b (diff)
Added by Daniel Alder about 5 years ago

[BUGFIX] Show correct number of inline records defined in flexform

getRelatedRecordsArray() is expecting comma separated list of record ids
Before this patch the full flexform xml was passed.
Now we detect whether a field is a flexform and try to extract the
correct field values from it.

Resolves: #56882
Releases: master, 6.2
Change-Id: I50db5dfd5f07bbc20e369c0a07f2f294afb85321
Reviewed-on: http://review.typo3.org/32985
Reviewed-by: Anja Leichsenring <>
Tested-by: Anja Leichsenring <>
Reviewed-by: Markus Klein <>
Tested-by: Markus Klein <>

History

#1 Updated by Oliver Hader over 5 years ago

  • Status changed from New to Needs Feedback

Please add the TCA field configuration for the relative parents

#2 Updated by Oliver Hader over 5 years ago

Please use https://git.typo3.org/Packages/TYPO3.CMS.git/tree/HEAD:/typo3/sysext/core/Tests/Functional/Fixtures/Extensions/irre_tutorial (e.g. linking that from the Core sources to your typo3conf/ext/ directory), the irre_tutorial in TER or SVN is outdated for 6.2 (new version after 6.2 release).

#3 Updated by Oliver Hader over 5 years ago

Could not reproduce your first test case (see test_case_1.png).
I did not check the FlexForm issue, but most likely there are problems I guess...

#4 Updated by Oliver Hader over 5 years ago

  • Category set to 978

#5 Updated by Tymoteusz Motylewski over 5 years ago

I've just tested it again with newest master version and irre_tutorial from core.
I've attached a screenshot (left side is a original record (english), right side is a translated record).

I've added new record on the left side, by clicking "create new under IRRE".
Problems:
A) if you colapse clild records, and then close the CE and open it again, you got different views depending on which record you expand first (the 1nff or IRRE). If you expand the 1nff first, then title is show correctly, but in IRRE "general" and "visibility" tabs are empty.
If you expand IRRE element first, then it is shown correctly, but the 1nff record has empty title

B) after translating the parent record (CE)there is a record visible in the 1nff, but it is missing in the IRRE section.
see right side of the screenshot

C) After adding second record to the english CE, and saving it, there are some problems in the translated CE
see screenshot scenario1_newirre2.png
notice that "Changed in original translation:" contains text
"Wellness Well-Being Hotel Rosengarten"
which is not correct - this is a title of the Hotel record with id 1, not the one associated with English CE.
Also "Localize all records" on the IRRE section doesn't work.
If you translate the record by clicking "Localize all records" in 1nff secion, then record is correctlt translated, but on the irre section it doesnt show up.

#6 Updated by Tymoteusz Motylewski over 5 years ago

SCENARIO2:
I've attached test extension.
A) screenshot scenario2_mediacenter.png
1. Create new CE "plugin"
2. Select "mediacenter" plugin
3. Attach 2 images in the plugin flex form
4. translate record using "copy default content elements"
5. You'll get a nice exception
#1317178794: No fileusage (sys_file_reference) found for given UID. (More information)
screenshot attached (notice the getFileReferenceObject("2") call - it takes number of related images as a file reference. If we had 3 images, then it will call getFileReferenceObject("3"))
6. reload the page, edit translated record,
only one image will be visible, but grayed out. The "localize" button is not working.

B) screenshot scenario2_B_mediacenter.png
1. Create new CE "plugin"
2. Select "mediacenter" plugin
3. Attach 3 images in the plugin flex form and one flv file
4. translate record using "Language: " selectbox on the top of the site, choose "Dansk NEW" from this selectbox
5. In the tranlstaed record you will get completely wrong images, see right side of the screenshot.

#7 Updated by Tymoteusz Motylewski over 5 years ago

attach screenshot of the exception from scenario 2A

#8 Updated by Alexander Opitz over 5 years ago

Hi,

does this issue still exists in 6.2.4?

#9 Updated by Tymoteusz Motylewski over 5 years ago

I've retested the issue with the recent master (Sun Jul 27 e172269f8db8720083c1e74eca03d9662a331185 ).
It is better, but the issue is NOT yet resolved.

Scenario 2:
A)
no exception any more, but after translating the record there are additional images in the localized record (see scenario2_new.png)
B)
works the same way as A) now

#10 Updated by Alexander Opitz over 5 years ago

  • Status changed from Needs Feedback to New

#11 Updated by Gerrit Code Review about 5 years ago

  • Status changed from New to Under Review

Patch set 1 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/32985

#12 Updated by Gerrit Code Review about 5 years ago

Patch set 2 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/32985

#13 Updated by Gerrit Code Review about 5 years ago

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/32986

#14 Updated by Daniel Alder about 5 years ago

Tymoteusz Motylewski wrote:

I've retested the issue with the recent master (Sun Jul 27 e172269f8db8720083c1e74eca03d9662a331185 ).
It is better, but the issue is NOT yet resolved.

Scenario 2:
A)
no exception any more, but after translating the record there are additional images in the localized record (see scenario2_new.png)
B)
works the same way as A) now

Since the function which got the releated records didn't expected a flexform xml field (pi_flexform) the ongoing process take the field as 'field with comma separated values'. In addition the 'explode' will be done over the whole xml, which is in 'pi_flexform'. So the result is not an array of IDs only. First and last array records includes the xml definitions. So the related records are incomplete as mentioned int the picture scenario2_new.png

Example:

Inline field used via TCA
Incomming field record: 1,2,3

Inline field used via flexfor

<T3FlexForms>
<data>
<sheet index="sDEF">
<language index="lDEF">
<field index="settings.irre.records">
<value index="vDEF">1,2,3</value>
</field>
</language>
</sheet>
</data>
</T3FlexForms>

The following patch will take care of this issue

#15 Updated by Gerrit Code Review about 5 years ago

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

#16 Updated by Gerrit Code Review about 5 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/32986

#17 Updated by Gerrit Code Review about 5 years ago

Patch set 3 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/32985

#18 Updated by Daniel Alder about 5 years ago

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

#19 Updated by Benni Mack about 1 year ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF