Bug #103601
Updated by Sybille Peters 7 months ago
h2. Versions
* TYPO3 v11 latest release and with latest 11.5 branch
* PHP 8.2
* test with "Settings" Debug preset
did not test with v12 and v13
h2. 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
<pre><code class="php">
'tx_sypets_tca_test_check' => [
'exclude' => 1,
'label' => 'Checkbox with allowLanguageSynchronization',
'config' => [
'type' => 'check',
'default' => 0,
'behaviour' => [
'allowLanguageSynchronization' => true
]
]
],
</code></pre>
(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
<pre>
(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
</pre>
in /var/www/t3coredev11/typo3/sysext/core/Classes/DataHandling/DataHandler.php line 8141
in function compareFieldArrayWithCurrentAndUnset
<pre><code class="php">
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 = (
</code></pre>
------
(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:
<pre>
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
</pre>