[BUGFIX] Fix xml2array values for attributes type NULL 45/27845/3
authorMarc Bastian Heinrichs <typo3@mbh-software.de>
Tue, 25 Feb 2014 15:10:05 +0000 (16:10 +0100)
committerMarkus Klein <klein.t3@mfc-linz.at>
Thu, 13 Mar 2014 11:18:12 +0000 (12:18 +0100)
Method array2xml converts elements with value NULL to
nodes with attribute type "NULL" and empty value, e.g.:
<node index="myIndex" type="NULL"></node>
This is not correct transformed back in xml2array and results
in an empty string as value.
This in turn results in wrong imported data using impexp with
xml format.

Resolves: #55082
Releases: 6.2
Change-Id: Icfea2f2b7524c44711866c3f75f06331a1958183
Reviewed-on: https://review.typo3.org/27845
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Reviewed-by: Markus Klein
Tested-by: Markus Klein
typo3/sysext/core/Classes/Utility/GeneralUtility.php
typo3/sysext/impexp/Tests/Functional/Import/PagesAndTtContentWithImages/DataSet/Assertion/importPagesAndRelatedTtContentWithDifferentImageToExistingData.csv
typo3/sysext/impexp/Tests/Functional/Import/PagesAndTtContentWithImages/DataSet/Assertion/importPagesAndRelatedTtContentWithImagesButWithoutStorageOnCaseInsensitiveFilesystems.csv
typo3/sysext/impexp/Tests/Functional/Import/PagesAndTtContentWithImages/DataSet/Assertion/importPagesAndRelatedTtContentWithImagesButWithoutStorageOnCaseSensitiveFilesystems.csv
typo3/sysext/impexp/Tests/Functional/Import/PagesAndTtContentWithImages/DataSet/Assertion/importPagesAndRelatedTtContentWithImagesOnCaseInsensitiveFilesystems.csv
typo3/sysext/impexp/Tests/Functional/Import/PagesAndTtContentWithImages/DataSet/Assertion/importPagesAndRelatedTtContentWithImagesOnCaseSensitiveFilesystems.csv
typo3/sysext/impexp/Tests/Functional/Import/PagesAndTtContentWithImages/DataSet/Assertion/importPagesAndRelatedTtContentWithSameImageToExistingData.csv

index 3519510..18a66d5 100644 (file)
@@ -2310,6 +2310,9 @@ class GeneralUtility {
                                                        case 'boolean':
                                                                $current[$tagName] = (bool) $current[$tagName];
                                                                break;
+                                                       case 'NULL':
+                                                               $current[$tagName] = NULL;
+                                                               break;
                                                        case 'array':
                                                                // MUST be an empty array since it is processed as a value; Empty arrays would end up here because they would have no tags inside...
                                                                $current[$tagName] = array();
index 38c0ab9..16f957b 100644 (file)
@@ -19,9 +19,9 @@
 ,1,0,1,2,"/user_upload/typo3_image2.jpg","f90bb9a35622f35b5279195e324eddbaec8164b2","19669f1e02c2f16705ec7587044c66443be70725","jpg","image/jpeg","typo3_image2.jpg","da9acdf1e105784a57bbffec9520969578287797","7958"
 ,2,0,1,2,"/user_upload/typo3_image2_01.jpg","299dc37e3c3428b85d9b39c353c6557fa834dac5","19669f1e02c2f16705ec7587044c66443be70725","jpg","image/jpeg","typo3_image2_01.jpg","e873c1e2ffd0f191e183a1057de3eef4d62e782d","5565"
 "sys_file_reference"
-,"uid","pid","uid_local","uid_foreign","tablenames","fieldname","table_local"
-,1,1,1,1,"tt_content","image","sys_file"
-,2,3,2,2,"tt_content","image","sys_file"
+,"uid","pid","uid_local","uid_foreign","tablenames","fieldname","table_local","title","description","alternative","link"
+,1,1,1,1,"tt_content","image","sys_file",\NULL,\NULL,\NULL,""
+,2,3,2,2,"tt_content","image","sys_file",\NULL,\NULL,\NULL,""
 "sys_file_metadata"
 ,"uid","pid","file","title","width","height","description","alternative","sys_language_uid","l10n_parent"
 ,1,0,1,Dummy image,400,300,"This is a dummy image.","Photo of program code",0,0
index 75fecf7..bd02432 100644 (file)
@@ -15,8 +15,8 @@
 ,"uid","pid","storage","type","identifier","identifier_hash","folder_hash","extension","mime_type","name","sha1","size"
 ,1,0,1,2,"/user_upload/typo3_image2.jpg","f90bb9a35622f35b5279195e324eddbaec8164b2","19669f1e02c2f16705ec7587044c66443be70725","jpg","image/jpeg","typo3_image2.jpg","da9acdf1e105784a57bbffec9520969578287797","7958"
 "sys_file_reference"
-,"uid","pid","uid_local","uid_foreign","tablenames","fieldname","table_local"
-,1,1,1,1,"tt_content","image","sys_file"
+,"uid","pid","uid_local","uid_foreign","tablenames","fieldname","table_local","title","description","alternative","link"
+,1,1,1,1,"tt_content","image","sys_file",\NULL,\NULL,\NULL,""
 "sys_file_metadata"
 ,"uid","pid","file","title","width","height","description","alternative","sys_language_uid","l10n_parent"
 ,1,0,1,Dummy image,400,300,"This is a dummy image.","Photo of program code",0,0
index f3aa17c..3c8f413 100644 (file)
@@ -15,8 +15,8 @@
 ,"uid","pid","storage","type","identifier","identifier_hash","folder_hash","extension","mime_type","name","sha1","size"
 ,1,0,1,2,"/user_upload/typo3_image2.jpg","f90bb9a35622f35b5279195e324eddbaec8164b2","19669f1e02c2f16705ec7587044c66443be70725","jpg","image/jpeg","typo3_image2.jpg","da9acdf1e105784a57bbffec9520969578287797","7958"
 "sys_file_reference"
-,"uid","pid","uid_local","uid_foreign","tablenames","fieldname","table_local"
-,1,1,1,1,"tt_content","image","sys_file"
+,"uid","pid","uid_local","uid_foreign","tablenames","fieldname","table_local","title","description","alternative","link"
+,1,1,1,1,"tt_content","image","sys_file",\NULL,\NULL,\NULL,""
 "sys_file_metadata"
 ,"uid","pid","file","title","width","height","description","alternative","sys_language_uid","l10n_parent"
 ,1,0,1,Dummy image,400,300,"This is a dummy image.","Photo of program code",0,0
index 75fecf7..bd02432 100644 (file)
@@ -15,8 +15,8 @@
 ,"uid","pid","storage","type","identifier","identifier_hash","folder_hash","extension","mime_type","name","sha1","size"
 ,1,0,1,2,"/user_upload/typo3_image2.jpg","f90bb9a35622f35b5279195e324eddbaec8164b2","19669f1e02c2f16705ec7587044c66443be70725","jpg","image/jpeg","typo3_image2.jpg","da9acdf1e105784a57bbffec9520969578287797","7958"
 "sys_file_reference"
-,"uid","pid","uid_local","uid_foreign","tablenames","fieldname","table_local"
-,1,1,1,1,"tt_content","image","sys_file"
+,"uid","pid","uid_local","uid_foreign","tablenames","fieldname","table_local","title","description","alternative","link"
+,1,1,1,1,"tt_content","image","sys_file",\NULL,\NULL,\NULL,""
 "sys_file_metadata"
 ,"uid","pid","file","title","width","height","description","alternative","sys_language_uid","l10n_parent"
 ,1,0,1,Dummy image,400,300,"This is a dummy image.","Photo of program code",0,0
index f3aa17c..3c8f413 100644 (file)
@@ -15,8 +15,8 @@
 ,"uid","pid","storage","type","identifier","identifier_hash","folder_hash","extension","mime_type","name","sha1","size"
 ,1,0,1,2,"/user_upload/typo3_image2.jpg","f90bb9a35622f35b5279195e324eddbaec8164b2","19669f1e02c2f16705ec7587044c66443be70725","jpg","image/jpeg","typo3_image2.jpg","da9acdf1e105784a57bbffec9520969578287797","7958"
 "sys_file_reference"
-,"uid","pid","uid_local","uid_foreign","tablenames","fieldname","table_local"
-,1,1,1,1,"tt_content","image","sys_file"
+,"uid","pid","uid_local","uid_foreign","tablenames","fieldname","table_local","title","description","alternative","link"
+,1,1,1,1,"tt_content","image","sys_file",\NULL,\NULL,\NULL,""
 "sys_file_metadata"
 ,"uid","pid","file","title","width","height","description","alternative","sys_language_uid","l10n_parent"
 ,1,0,1,Dummy image,400,300,"This is a dummy image.","Photo of program code",0,0
index 3af9047..53d2bba 100644 (file)
@@ -18,9 +18,9 @@
 ,"uid","pid","storage","type","identifier","identifier_hash","folder_hash","extension","mime_type","name","sha1","size"
 ,1,0,1,2,"/user_upload/typo3_image2.jpg","f90bb9a35622f35b5279195e324eddbaec8164b2","19669f1e02c2f16705ec7587044c66443be70725","jpg","image/jpeg","typo3_image2.jpg","da9acdf1e105784a57bbffec9520969578287797","7958"
 "sys_file_reference"
-,"uid","pid","uid_local","uid_foreign","tablenames","fieldname","table_local"
-,1,1,1,1,"tt_content","image","sys_file"
-,2,3,1,2,"tt_content","image","sys_file"
+,"uid","pid","uid_local","uid_foreign","tablenames","fieldname","table_local","title","description","alternative","link"
+,1,1,1,1,"tt_content","image","sys_file",\NULL,\NULL,\NULL,""
+,2,3,1,2,"tt_content","image","sys_file",\NULL,\NULL,\NULL,""
 "sys_file_metadata"
 ,"uid","pid","file","title","width","height","description","alternative","sys_language_uid","l10n_parent"
 ,1,0,1,New title of the dummy image,400,300,"This is a dummy image.","Photo of program code",0,0