Commit 9da6bd15 authored by Andreas Wolf's avatar Andreas Wolf Committed by Andreas Wolf
Browse files

[FOLLOWUP][BUGFIX] Empty array not encoded as empty XML tag

Use empty() to check for empty array.

Also fix the failing functional tests by adjusting the fixtures
accordingly

Change-Id: I8d910f90f45e052afef05be7171116dfaf1166bf
Resolves: #71394
Releases: 6.2, master
Reviewed-on: https://review.typo3.org/44600


Reviewed-by: Andreas Wolf's avatarAndreas Wolf <andreas.wolf@typo3.org>
Tested-by: Andreas Wolf's avatarAndreas Wolf <andreas.wolf@typo3.org>
parent 9b4e2e5e
......@@ -2136,7 +2136,7 @@ class GeneralUtility
$subOptions = $options;
$clearStackPath = false;
}
if (count($v) === 0) {
if (empty($v)) {
$content = '';
} else {
$content = $nl . self::array2xml($v, $NSprefix, ($level + 1), '', $spaceInd, $subOptions, array(
......
......@@ -8,10 +8,8 @@
<pid>0</pid>
<title>Root</title>
<size>162</size>
<relations index="rels" type="array">
</relations>
<softrefs type="array">
</softrefs>
<relations index="rels" type="array"></relations>
<softrefs type="array"></softrefs>
</rec>
</table>
<table index="tx_impexpgroupfiles_item" type="array">
......@@ -26,8 +24,7 @@
<id>3</id>
</element>
</relations>
<softrefs type="array">
</softrefs>
<softrefs type="array"></softrefs>
<filerefs type="array">
<file index="0">66a2b7534be9ebf810cd55164c5f085d</file>
</filerefs>
......@@ -46,8 +43,7 @@
<table>sys_file_storage</table>
</element>
</relations>
<softrefs type="array">
</softrefs>
<softrefs type="array"></softrefs>
</rec>
</table>
<table index="sys_file_storage" type="array">
......@@ -57,10 +53,8 @@
<title>fileadmin/ (auto-created)</title>
<size>722</size>
<relationLevel>2</relationLevel>
<relations index="rels" type="array">
</relations>
<softrefs type="array">
</softrefs>
<relations index="rels" type="array"></relations>
<softrefs type="array"></softrefs>
</rec>
</table>
</records>
......@@ -115,8 +109,7 @@
<field index="title">Root</field>
<field index="doktype">1</field>
</fieldlist>
<related index="rels" type="array">
</related>
<related index="rels" type="array"></related>
</tablerow>
<tablerow index="tx_impexpgroupfiles_item:1" type="array">
<fieldlist index="data" type="array">
......@@ -214,12 +207,9 @@
<field index="configuration" type="array">
<type>flex</type>
<flexform index="flexFormRels" type="array">
<db_relations index="db" type="array">
</db_relations>
<file_relations index="file" type="array">
</file_relations>
<softref_relations index="softrefs" type="array">
</softref_relations>
<db_relations index="db" type="array"></db_relations>
<file_relations index="file" type="array"></file_relations>
<softref_relations index="softrefs" type="array"></softref_relations>
</flexform>
</field>
</related>
......
......@@ -8,10 +8,8 @@
<pid>1</pid>
<title>Dummy 1-2</title>
<size>167</size>
<relations index="rels" type="array">
</relations>
<softrefs type="array">
</softrefs>
<relations index="rels" type="array"></relations>
<softrefs type="array"></softrefs>
</rec>
</table>
<table index="tx_impexpgroupfiles_item" type="array">
......@@ -58,8 +56,7 @@
<table>sys_file_storage</table>
</element>
</relations>
<softrefs type="array">
</softrefs>
<softrefs type="array"></softrefs>
</rec>
<rec index="2" type="array">
<uid>2</uid>
......@@ -73,8 +70,7 @@
<table>sys_file_storage</table>
</element>
</relations>
<softrefs type="array">
</softrefs>
<softrefs type="array"></softrefs>
</rec>
</table>
<table index="sys_file_storage" type="array">
......@@ -84,10 +80,8 @@
<title>fileadmin/ (auto-created)</title>
<size>722</size>
<relationLevel>2</relationLevel>
<relations index="rels" type="array">
</relations>
<softrefs type="array">
</softrefs>
<relations index="rels" type="array"></relations>
<softrefs type="array"></softrefs>
</rec>
</table>
</records>
......@@ -150,8 +144,7 @@
<field index="title">Dummy 1-2</field>
<field index="doktype">1</field>
</fieldlist>
<related index="rels" type="array">
</related>
<related index="rels" type="array"></related>
</tablerow>
<tablerow index="tx_impexpgroupfiles_item:2" type="array">
<fieldlist index="data" type="array">
......@@ -318,12 +311,9 @@
<field index="configuration" type="array">
<type>flex</type>
<flexform index="flexFormRels" type="array">
<db_relations index="db" type="array">
</db_relations>
<file_relations index="file" type="array">
</file_relations>
<softref_relations index="softrefs" type="array">
</softref_relations>
<db_relations index="db" type="array"></db_relations>
<file_relations index="file" type="array"></file_relations>
<softref_relations index="softrefs" type="array"></softref_relations>
</flexform>
</field>
</related>
......
......@@ -8,10 +8,8 @@
<pid>0</pid>
<title>Root</title>
<size>162</size>
<relations index="rels" type="array">
</relations>
<softrefs type="array">
</softrefs>
<relations index="rels" type="array"></relations>
<softrefs type="array"></softrefs>
</rec>
</table>
<table index="tx_impexpgroupfiles_item" type="array">
......@@ -26,8 +24,7 @@
<id>3</id>
</element>
</relations>
<softrefs type="array">
</softrefs>
<softrefs type="array"></softrefs>
<filerefs type="array">
<file index="0">66a2b7534be9ebf810cd55164c5f085d</file>
</filerefs>
......@@ -46,8 +43,7 @@
<table>sys_file_storage</table>
</element>
</relations>
<softrefs type="array">
</softrefs>
<softrefs type="array"></softrefs>
</rec>
</table>
<table index="sys_file_storage" type="array">
......@@ -57,10 +53,8 @@
<title>fileadmin/ (auto-created)</title>
<size>722</size>
<relationLevel>2</relationLevel>
<relations index="rels" type="array">
</relations>
<softrefs type="array">
</softrefs>
<relations index="rels" type="array"></relations>
<softrefs type="array"></softrefs>
</rec>
</table>
</records>
......@@ -115,8 +109,7 @@
<field index="title">Root</field>
<field index="doktype">1</field>
</fieldlist>
<related index="rels" type="array">
</related>
<related index="rels" type="array"></related>
</tablerow>
<tablerow index="tx_impexpgroupfiles_item:1" type="array">
<fieldlist index="data" type="array">
......@@ -214,12 +207,9 @@
<field index="configuration" type="array">
<type>flex</type>
<flexform index="flexFormRels" type="array">
<db_relations index="db" type="array">
</db_relations>
<file_relations index="file" type="array">
</file_relations>
<softref_relations index="softrefs" type="array">
</softref_relations>
<db_relations index="db" type="array"></db_relations>
<file_relations index="file" type="array"></file_relations>
<softref_relations index="softrefs" type="array"></softref_relations>
</flexform>
</field>
</related>
......
......@@ -8,10 +8,8 @@
<pid>0</pid>
<title>IRRE</title>
<size>162</size>
<relations index="rels" type="array">
</relations>
<softrefs type="array">
</softrefs>
<relations index="rels" type="array"></relations>
<softrefs type="array"></softrefs>
</rec>
</table>
<table index="tt_content" type="array">
......@@ -38,8 +36,7 @@
<table>tx_irretutorial_1ncsv_hotel</table>
</element>
</relations>
<softrefs type="array">
</softrefs>
<softrefs type="array"></softrefs>
</rec>
</table>
<table index="tx_irretutorial_1ncsv_hotel" type="array">
......@@ -54,8 +51,7 @@
<table>tx_irretutorial_1ncsv_offer</table>
</element>
</relations>
<softrefs type="array">
</softrefs>
<softrefs type="array"></softrefs>
</rec>
<rec index="1" type="array">
<uid>1</uid>
......@@ -72,8 +68,7 @@
<table>tx_irretutorial_1ncsv_offer</table>
</element>
</relations>
<softrefs type="array">
</softrefs>
<softrefs type="array"></softrefs>
</rec>
</table>
<table index="tx_irretutorial_1ncsv_offer" type="array">
......@@ -88,8 +83,7 @@
<table>tx_irretutorial_1ncsv_price</table>
</element>
</relations>
<softrefs type="array">
</softrefs>
<softrefs type="array"></softrefs>
</rec>
<rec index="2" type="array">
<uid>2</uid>
......@@ -102,8 +96,7 @@
<table>tx_irretutorial_1ncsv_price</table>
</element>
</relations>
<softrefs type="array">
</softrefs>
<softrefs type="array"></softrefs>
</rec>
<rec index="1" type="array">
<uid>1</uid>
......@@ -116,8 +109,7 @@
<table>tx_irretutorial_1ncsv_price</table>
</element>
</relations>
<softrefs type="array">
</softrefs>
<softrefs type="array"></softrefs>
</rec>
</table>
<table index="tx_irretutorial_1ncsv_price" type="array">
......@@ -126,30 +118,24 @@
<pid>1</pid>
<title>Price 2.2.1 (csv)</title>
<size>254</size>
<relations index="rels" type="array">
</relations>
<softrefs type="array">
</softrefs>
<relations index="rels" type="array"></relations>
<softrefs type="array"></softrefs>
</rec>
<rec index="2" type="array">
<uid>2</uid>
<pid>1</pid>
<title>Price 1.2.1 (csv)</title>
<size>254</size>
<relations index="rels" type="array">
</relations>
<softrefs type="array">
</softrefs>
<relations index="rels" type="array"></relations>
<softrefs type="array"></softrefs>
</rec>
<rec index="1" type="array">
<uid>1</uid>
<pid>1</pid>
<title>Price 1.1.1 (csv)</title>
<size>255</size>
<relations index="rels" type="array">
</relations>
<softrefs type="array">
</softrefs>
<relations index="rels" type="array"></relations>
<softrefs type="array"></softrefs>
</rec>
</table>
<table index="tx_irretutorial_1nff_hotel" type="array">
......@@ -168,8 +154,7 @@
<table>tx_irretutorial_1nff_offer</table>
</element>
</relations>
<softrefs type="array">
</softrefs>
<softrefs type="array"></softrefs>
</rec>
<rec index="2" type="array">
<uid>2</uid>
......@@ -182,8 +167,7 @@
<table>tx_irretutorial_1nff_offer</table>
</element>
</relations>
<softrefs type="array">
</softrefs>
<softrefs type="array"></softrefs>
</rec>
</table>
<table index="tx_irretutorial_1nff_offer" type="array">
......@@ -202,8 +186,7 @@
<table>tx_irretutorial_1nff_price</table>
</element>
</relations>
<softrefs type="array">
</softrefs>
<softrefs type="array"></softrefs>
</rec>
<rec index="3" type="array">
<uid>3</uid>
......@@ -216,8 +199,7 @@
<table>tx_irretutorial_1nff_price</table>
</element>
</relations>
<softrefs type="array">
</softrefs>
<softrefs type="array"></softrefs>
</rec>
<rec index="2" type="array">
<uid>2</uid>
......@@ -230,8 +212,7 @@
<table>tx_irretutorial_1nff_price</table>
</element>
</relations>
<softrefs type="array">
</softrefs>
<softrefs type="array"></softrefs>
</rec>
</table>
<table index="tx_irretutorial_1nff_price" type="array">
......@@ -240,40 +221,32 @@
<pid>1</pid>
<title>Price 1.1.1 (nff)</title>
<size>358</size>
<relations index="rels" type="array">
</relations>
<softrefs type="array">
</softrefs>
<relations index="rels" type="array"></relations>
<softrefs type="array"></softrefs>
</rec>
<rec index="3" type="array">
<uid>3</uid>
<pid>1</pid>
<title>Price 1.2.1 (nff)</title>
<size>360</size>
<relations index="rels" type="array">
</relations>
<softrefs type="array">
</softrefs>
<relations index="rels" type="array"></relations>
<softrefs type="array"></softrefs>
</rec>
<rec index="4" type="array">
<uid>4</uid>
<pid>1</pid>
<title>Price 2.1.1 (nff)</title>
<size>365</size>
<relations index="rels" type="array">
</relations>
<softrefs type="array">
</softrefs>
<relations index="rels" type="array"></relations>
<softrefs type="array"></softrefs>
</rec>
<rec index="2" type="array">
<uid>2</uid>
<pid>1</pid>
<title>Price 1.1.2 (nff)</title>
<size>360</size>
<relations index="rels" type="array">
</relations>
<softrefs type="array">
</softrefs>
<relations index="rels" type="array"></relations>
<softrefs type="array"></softrefs>
</rec>
</table>
<table index="tx_irretutorial_mnasym_hotel" type="array">
......@@ -292,8 +265,7 @@
<table>tx_irretutorial_mnasym_hotel_offer_rel</table>
</element>
</relations>
<softrefs type="array">
</softrefs>
<softrefs type="array"></softrefs>
</rec>
</table>
<table index="tx_irretutorial_mnasym_hotel_offer_rel" type="array">
......@@ -316,8 +288,7 @@
<table>tx_irretutorial_mnasym_price</table>
</element>
</relations>
<softrefs type="array">
</softrefs>
<softrefs type="array"></softrefs>
</rec>
<rec index="2" type="array">
<uid>2</uid>
......@@ -338,8 +309,7 @@
<table>tx_irretutorial_mnasym_price</table>
</element>
</relations>
<softrefs type="array">
</softrefs>
<softrefs type="array"></softrefs>
</rec>
</table>
<table index="tx_irretutorial_mnasym_offer" type="array">
......@@ -354,8 +324,7 @@
<table>tx_irretutorial_mnasym_hotel_offer_rel</table>
</element>
</relations>
<softrefs type="array">
</softrefs>
<softrefs type="array"></softrefs>
</rec>
<rec index="1" type="array">
<uid>1</uid>
......@@ -368,8 +337,7 @@
<table>tx_irretutorial_mnasym_hotel_offer_rel</table>
</element>
</relations>
<softrefs type="array">
</softrefs>
<softrefs type="array"></softrefs>
</rec>
</table>
<table index="tx_irretutorial_mnasym_price" type="array">
......@@ -378,20 +346,16 @@
<pid>1</pid>
<title>Price 1 1:2 (m:n ASym)</title>
<size>281</size>
<relations index="rels" type="array">
</relations>
<softrefs type="array">
</softrefs>
<relations index="rels" type="array"></relations>
<softrefs type="array"></softrefs>
</rec>
<rec index="2" type="array">
<uid>2</uid>
<pid>1</pid>
<title>Price 2 1:1 (m:n ASym)</title>
<size>280</size>
<relations index="rels" type="array">
</relations>
<softrefs type="array">
</softrefs>
<relations index="rels" type="array"></relations>
<softrefs type="array"></softrefs>
</rec>
</table>
<table index="tx_irretutorial_mnattr_hotel" type="array">
......@@ -406,8 +370,7 @@
<table>tx_irretutorial_mnattr_hotel_offer_rel</table>
</element>
</relations>
<softrefs type="array">
</softrefs>
<softrefs type="array"></softrefs>
</rec>
<rec index="2" type="array">
<uid>2</uid>
......@@ -420,8 +383,7 @@
<table>tx_irretutorial_mnattr_hotel_offer_rel</table>
</element>
</relations>
<softrefs type="array">
</softrefs>
<softrefs type="array"></softrefs>
</rec>
</table>
<table index="tx_irretutorial_mnattr_hotel_offer_rel" type="array">
......@@ -440,8 +402,7 @@
<table>tx_irretutorial_mnattr_offer</table>
</element>
</relations>
<softrefs type="array">
</softrefs>
<softrefs type="array"></softrefs>
</rec>
<rec index="2" type="array">
<uid>2</uid>
......@@ -458,8 +419,7 @@
<table>tx_irretutorial_mnattr_offer</table>
</element>
</relations>
<softrefs type="array">
</softrefs>
<softrefs type="array"></softrefs>
</rec>
</table>
<table index="tx_irretutorial_mnattr_offer" type="array">
......@@ -474,8 +434,7 @@
<table>tx_irretutorial_mnattr_hotel_offer_rel</table>
</element>
</relations>
<softrefs type="array">
</softrefs>
<softrefs type="array"></softrefs>
</rec>
<rec index="2" type="array">
<uid>2</uid>
......@@ -488,8 +447,7 @@
<table>tx_irretutorial_mnattr_hotel_offer_rel</table>
</element>
</relations>
<softrefs type="array">
</softrefs>
<softrefs type="array"></softrefs>
</rec>
</table>
<table index="tx_irretutorial_mnmmasym_hotel" type="array">
......@@ -508,8 +466,7 @@
<table>tx_irretutorial_mnmmasym_offer</table>
</element>
</relations>
<softrefs type="array">
</softrefs>
<softrefs type="array"></softrefs>
</rec>
<rec index="2" type="array">
<uid>2</uid>
......@@ -522,8 +479,7 @@
<table>tx_irretutorial_mnmmasym_offer</table>
</element>
</relations>
<softrefs type="array">
</softrefs>
<softrefs type="array"></softrefs>
</rec>
</table>
<table index="tx_irretutorial_mnmmasym_offer" type="array">
......@@ -538,8 +494,7 @@
<table>tx_irretutorial_mnmmasym_price</table>
</element>
</relations>
<softrefs type="array">
</softrefs>
<softrefs type="array"></softrefs>
</rec>
<rec index="2" type="array">
<uid>2</uid>
......@@ -552,8 +507,7 @@
<table>tx_irretutorial_mnmmasym_price</table>
</element>
</relations>
<softrefs type="array">
</softrefs>