Project

General

Profile

Actions

Bug #97616

closed

Bodytext of default Language shown in Translation on NULL

Added by André Buchmann almost 2 years ago. Updated over 1 year ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2022-05-12
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
12
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

Problem:

Translated content elements are showing the bodytext content of the default language instead of nothing when value is NULL instead of empty string ''

Short:

  • Language is set to "strict" mode in site configuration.
  • Content element (= ce) is translated using the connected mode.
  • Bodytext field value of translation is NULL instead of empty string ''
  • Bodytext field of default language has some content.

How to reproduce?

  1. Setup TYPO3 10/11/main with at least two languages. Use strict mode.
  2. Create a ce "Header".
  3. Then translate this ce (connected mode).
  4. Edit the ce in the default language:
    • Switch type to "Text & Media"
    • Add some content to the bodytext field

Optional Steps:

  • Change the translated ce also to "Text & Media" and save. But DON'T touch the bodytext field!
  • Check your database: Is the bodytext value NULL or ''

When you create a textmedia directly or delete text from the bodytext with the RTE, the field will be saved as empty string.

The field is defined as bodytext mediumtext, in the ext_tables.sql. Therefore IMHO NULL and empty string '' should behave the same way.

--

You find example data for a very basic setup attached (Site config + Dump: sys_template, pages & tt_content)


Files

test_data.sql (22.3 KB) test_data.sql André Buchmann, 2022-05-12 11:18
config.yaml (606 Bytes) config.yaml André Buchmann, 2022-05-12 11:18
Actions #1

Updated by André Buchmann almost 2 years ago

Location where the error is created in PageRepository: https://github.com/typo3/typo3/blob/279ccf1f77b360fe3731ba9026f5bbc8628ec659/typo3/sysext/core/Classes/Domain/Repository/PageRepository.php#L692-L698

isset($olrow[$fN]) evaluates true with this:

$olrow[
'bodytext' => ''
];

But false whith this:

$olrow[
'bodytext' => null
];

And then the overlay is skipped and the value of the default language stays in the $row

Actions #2

Updated by Gerrit Code Review almost 2 years ago

  • Status changed from New to Under Review

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

Actions #3

Updated by Gerrit Code Review almost 2 years ago

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

Actions #4

Updated by Gerrit Code Review almost 2 years ago

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

Actions #5

Updated by Gerrit Code Review almost 2 years ago

Patch set 1 for branch 11.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/+/74834

Actions #6

Updated by Gerrit Code Review almost 2 years ago

Patch set 2 for branch 11.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/+/74834

Actions #7

Updated by Anonymous almost 2 years ago

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

Updated by Gerrit Code Review almost 2 years ago

  • Status changed from Resolved to Under Review

Patch set 3 for branch 11.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/+/74834

Actions #9

Updated by Gerrit Code Review almost 2 years ago

Patch set 4 for branch 11.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/+/74834

Actions #10

Updated by Gerrit Code Review almost 2 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/+/74837

Actions #11

Updated by Gerrit Code Review almost 2 years ago

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/+/74837

Actions #12

Updated by Anonymous almost 2 years ago

  • Status changed from Under Review to Resolved
Actions #13

Updated by Gerrit Code Review almost 2 years ago

  • Status changed from Resolved to Under Review

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/+/74837

Actions #14

Updated by Gerrit Code Review almost 2 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/+/74837

Actions #15

Updated by Anonymous almost 2 years ago

  • Status changed from Under Review to Resolved
Actions #16

Updated by Benni Mack over 1 year ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF