Issue Bug Closed

#103601Setting l18n_parent to empty results in exception if Debug Preset is used and extension with allowLanguageSynchronization

Sybille Peters 04/11/24, 09:55 updated 12/01/24, 13:53

Description

Versions

  • TYPO3 versions: v11 (latest 11.5 branch and latest release), not reproducible with v13 (latest main) and v12 (latest 12.4 ranch)
  • PHP 8.2
  • test with “Settings” Debug preset

did not test with v12 and v13

Reproduce

Ideally use an extension which adds a field to tt_content which has allowLanguageSynchronization true, e.g.

use extension https://github.com/sypets/sypets_tca_test

'tx_sypets_tca_test_check' => [
        'exclude' => 1,
        'label' => 'Checkbox with allowLanguageSynchronization',
        'config' => [
            'type' => 'check',
            'default' => 0,
            'behaviour' => [
                'allowLanguageSynchronization' => true
            ]
        ]
    ],

(1)

extension is activated, Debug mode

1. create translation page, translate with connected mode
2. edit translated element, set translate origin to empty and save

Exception is thrown, change is not successful

(1/1) #1476107295 TYPO3\CMS\Core\Error\Exception
PHP Warning: Array to string conversion in /var/www/t3coredev11/typo3/sysext/core/Classes/DataHandling/DataHandler.php line 8141

in /var/www/t3coredev11/typo3/sysext/core/Classes/DataHandling/DataHandler.php line 8141

in function compareFieldArrayWithCurrentAndUnset

8137    {
8138        // No NULL values are allowed, this is the regular behaviour.
8139        // Thus, check whether strings are the same or whether integer values are empty ("0" or "").
8140        if (!$allowNull) {
8141            $result = (string)$submittedValue === (string)$storedValue || $storedType === 'int' && (int)$storedValue === (int)$submittedValue;
        // Null values are allowed, but currently there's a real (not NULL) value.
        // Thus, ensure no NULL value was submitted and fallback to the regular behaviour.
        } elseif ($storedValue !== null) {
            $result = (

———

(2)

extension is activated, Live mode

1. create translation page, translate with connected mode
2. edit translated element, set translate origin to empty and save

Change is successful

check log:

Thu, 11 Apr 2024 09:44:59 +0000 [WARNING] request="c78d853f870f9" component="TYPO3.CMS.Core.Error.ErrorHandler": Core: Error handler (BE): PHP Warning: Array to string conversion in /var/www/t3coredev11/typo3/sysext/core/Classes/DataHandling/DataHandler.php line 8141 
Thu, 11 Apr 2024 09:44:59 +0000 [WARNING] request="c78d853f870f9" component="TYPO3.CMS.Core.Error.ErrorHandler": Core: Error handler (BE): PHP Warning: Array to string conversion in /var/www/t3coredev11/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php line 164 
Thu, 11 Apr 2024 09:44:59 +0000 [WARNING] request="c78d853f870f9" component="TYPO3.CMS.Core.Error.ErrorHandler": Core: Error handler (BE): PHP Warning: Array to string conversion in /var/www/t3coredev11/typo3/sysext/core/Classes/DataHandling/DataHandler.php line 7530 

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.