[
https://issues.apache.org/jira/browse/CB-9145?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14579294#comment-14579294
]
ASF GitHub Bot commented on CB-9145:
------------------------------------
GitHub user tony-- opened a pull request:
https://github.com/apache/cordova-lib/pull/242
fix CB-9145 prepare can lose data during config munge
I added a test that adds access tags as described in CB-9145. This test
fails when run against master.
This is because the current exact match detection assumes that the query
returning a result is sufficient to identify an exact attribute match.
However, the query may also return results with additional attributes and these
should be excluded.
Originally I added a utility function that handles this case by performing
a 2-way comparison. However, we already know that foundChild.attr matches
srcChild.attr because foundChild is a query result. We only need to determine
if foundChild has extra attributes, so simply comparing the number of
attributes is sufficient.
After making this change, all tests are green - including the newly added
test that fails against master.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/tony--/cordova-lib CB-9145
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/cordova-lib/pull/242.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #242
----
commit 25982317b26c831dbea9d6b71dd57a90b933fc68
Author: Tony Homer <[email protected]>
Date: 2015-06-09T17:05:10Z
fix CB-9145 prepare can lose data during config munge
----
> prepare can lose data during config munge
> -----------------------------------------
>
> Key: CB-9145
> URL: https://issues.apache.org/jira/browse/CB-9145
> Project: Apache Cordova
> Issue Type: Bug
> Components: CordovaLib
> Affects Versions: Master
> Reporter: Tony Homer
>
> If a node is added to config.xml with same name and matching attributes as an
> existing node, but it is missing attributes, it is treated as an exact match
> during config munge and is not added to platform config.xml. For example,
> when the following tags are present in www/config.xml, then second tag will
> not be added to platforms/android/res/xml/config.xml:
> {code}
> <access origin="*" launch-external="yes"/>
> <access origin="*" />
> {code}
> AFAIK, this is most important for access tags, but will affect any tag where
> it is possible for one tag to be a subset of another tag.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]