[ 
https://issues.apache.org/jira/browse/CB-13979?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16480697#comment-16480697
 ] 

ASF GitHub Bot commented on CB-13979:
-------------------------------------

dpogue commented on a change in pull request #19: CB-13979: More consistency 
for config.xml lookups
URL: https://github.com/apache/cordova-common/pull/19#discussion_r189279473
 
 

 ##########
 File path: spec/fixtures/test-config.xml
 ##########
 @@ -82,6 +82,7 @@
     <preference name="orientation" value="portrait" />
     <icon id="icon" src="icon.png" />
     <icon height="255" id="logo" src="logo.png" width="255" />
+    <platform name="android"></platform>
 
 Review comment:
   That is what causes the bug described in CB-13979, although I agree it's a 
weird scenario.
   
   If I add the empty platform tag without the rest of these changes, existing 
tests fail.
   With these changes, they pass even when the empty platform tag is present.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


> getEditConfigs() and getConfigFiles() only work for the first <platform> tag
> ----------------------------------------------------------------------------
>
>                 Key: CB-13979
>                 URL: https://issues.apache.org/jira/browse/CB-13979
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: cordova-common
>    Affects Versions: Master
>            Reporter: Kevin Christopher Henry
>            Assignee: Darryl Pogue
>            Priority: Minor
>              Labels: pull-request-available
>
> I ran into something strange - my configuration would change based on the 
> ordering of elements in config.xml.
> Looking at the source code, the culprit is getEditConfigs() and 
> getConfigFiles() in ConfigParser.js. Unlike the rest of the code they only 
> look in the first platform tag for config directives:
> {{var platform_tag = this.doc.find('./platform[@name="' + platform + '"]');}}
> {{var platform_edit_configs = platform_tag ? 
> platform_tag.findall('edit-config') : [];}}
> This should probably be something like this instead (untested):
> {{var platform_edit_configs = this.doc.findall('./platform[@name="' + 
> platform + '"]/edit-config');}}
> And similarly for getConfigFiles().



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to