Project

General

Profile

Actions

Bug #20949

closed

Saving translation: strcmp() expects parameter 2 to be string

Added by Steffen Gebert over 14 years ago. Updated over 13 years ago.

Status:
Closed
Priority:
Should have
Category:
Extension Manager
Target version:
-
Start date:
2009-08-28
Due date:
% Done:

0%

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

Description

Warning: strcmp() expects parameter 2 to be string, array given in t3lib/class.t3lib_befunc.php on line 2888

After "save selection" in the submodule "Translation handling".

PHP 5.3 only?

(issue imported from #M11815)


Files

11815.diff (798 Bytes) 11815.diff Administrator Admin, 2009-08-28 13:52
11815-v2.diff (1.28 KB) 11815-v2.diff Administrator Admin, 2009-09-24 16:29

Related issues 3 (0 open3 closed)

Related to TYPO3 Core - Bug #21136: PHP5.3-Warning about strcmp() parameters in view_help.phpClosedRupert Germann2009-09-24

Actions
Has duplicate TYPO3 Core - Bug #21111: TYPO3 4.3-devClosedOliver Hader2009-09-21

Actions
Has duplicate TYPO3 Core - Bug #19199: PHP 5.3 throws warning when saving localization settings in EMClosedRupert Germann2008-08-06

Actions
Actions #1

Updated by Steffen Gebert over 14 years ago

Seems really to be PHP 5.3 only. Before str_cmp() didn't bleat about the array.

Actions #2

Updated by Stefan Geith over 14 years ago

I tracked this down a little.
I have set 'german' and clicked on save:

the following variables want to get compared by strcmp:
$settings[selectedLanguages] = "a:1:{i:0;s:2:"de";}"
$CHANGED_SETTINGS[selectedLanguages] = Array(0 => 'de')

for e.g. two languages, these are the variables:
$settings[selectedLanguages] = "a:1:{i:0;s:2:"de";}"
$CHANGED_SETTINGS[selectedLanguages] = Array(0 => 'de', 1=>'en')

Conclusion:
If $CHANGED_SETTINGS[$key] is an array, THEN the serialized array has to be compared with $settings[$key]:

if (is_array($CHANGED_SETTINGS) && isset($CHANGED_SETTINGS[$key])) {
if ( !is_array($CHANGED_SETTINGS[$key]) && strcmp($settings[$key], $CHANGED_SETTINGS[$key]) ) {
$settings[$key] = $CHANGED_SETTINGS[$key];
$changed = 1;
}
if ( is_array($CHANGED_SETTINGS[$key]) && strcmp($settings[$key], serialize($CHANGED_SETTINGS[$key])) ) {
$settings[$key] = serialize($CHANGED_SETTINGS[$key]);
$changed = 1;
}
}

Actions #3

Updated by Stefan Geith over 14 years ago

Corresponding Version of patch (11815-v2.diff) attached.

Actions #4

Updated by Steffen Gebert over 14 years ago

This is a duplicate of #19199. Please set the relationship (and vote ;))

Actions #5

Updated by Francois Suter about 14 years ago

Committed to 4.3 in revision 6781
Committed to trunk revision 6782

Actions

Also available in: Atom PDF