Skip to content
This repository has been archived by the owner on Sep 12, 2022. It is now read-only.

Self closing xml tags are converted to open and close tags #16

Open
tmotyl opened this issue May 13, 2016 · 0 comments
Open

Self closing xml tags are converted to open and close tags #16

tmotyl opened this issue May 13, 2016 · 0 comments

Comments

@tmotyl
Copy link

tmotyl commented May 13, 2016

If you have self closing xml tags like in the local.xml, EnvSettingsTool will convert the tag on saving to which breaks Magento in some cases. The conversion happens also if you're no changing the tag itself, but something else in the file.

Because of that you can not place

<global>
<request>
            <direct_front_name>
                <yourfrontname/>
            </direct_front_name>

because it will be converted to

<global>
<request>
            <direct_front_name>
                <yourfrontname><yourfrontname/>
            </direct_front_name>

on save. And Magento can not handle it.

The problem is caused by setting LIBXML_NOEMPTYTAG on saving the xml.
see
https://github.com/AOEpeople/EnvSettingsTool/blob/master/Est/Handler/XmlFile.php#L77

Unfortunatelly removing the LIBXML_NOEMPTYTAG setting will cause all empty nodes to be saved as self-closing.
e.g.
<password><![CDATA[]]></password>
will be saved as
<password/>

However if we want to keep tag with empty value, we can use cdata:

<password><![CDATA[]]></password>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant