You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2016/10/15 00:57:20 UTC
[jira] [Commented] (CB-11967) Cordova Plugin default preferences
loaded as 'undefined' value inside cordova project.
[ https://issues.apache.org/jira/browse/CB-11967?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15577043#comment-15577043 ]
ASF subversion and git services commented on CB-11967:
------------------------------------------------------
Commit afcffc59ad186ae98518ac890fd942d3ca7069d8 in cordova-lib's branch refs/heads/master from [~Nikita Matrosov]
[ https://git-wip-us.apache.org/repos/asf?p=cordova-lib.git;h=afcffc5 ]
CB-11951 CB-11967: Respect preference default values when install plugin
> Cordova Plugin default preferences loaded as 'undefined' value inside cordova project.
> --------------------------------------------------------------------------------------
>
> Key: CB-11967
> URL: https://issues.apache.org/jira/browse/CB-11967
> Project: Apache Cordova
> Issue Type: Bug
> Affects Versions: 6.3.1
> Reporter: Iñaki Vitoria
>
> Scenario
> ========
> Creating a new cordova Plugin.
> Setting preferences and default values in different platforms inside plugin.xml file.
> Once the plugin is added to the project and built, resultant DEFAULT values aren´t loaded and set to 'undefined'.
> PROJECT SAMPLE CODE PROVIDED
> ============================
> Only relevant lines of code are included, everything else has been removed since is automatically generated by cordova.
> <?xml version="1.0" encoding="utf-8"?>
> <plugin id="cordova-plugin-sampleplugin" version="0.0.4"
>
> xmlns="http://www.phonegap.com/ns/plugins/1.0"
> xmlns:android="http://schemas.android.com/apk/res/android">
> <name>Plugin</name>
> <preference name="SAMPLE_PREF_1" default="value1" />
> <preference name="SAMPLE_PREF_2" default="value2" />
> <preference name="SAMPLE_PREF_3" default="value3" />
> <engines>
> <engine name="cordova" version=">=3.4.0" />
> </engines>
>
> <asset src="www/SamplePlugin.js" target="js/SamplePlugin.js" />
> <platform name="android">
>
> <config-file parent="/*" target="res/xml/config.xml">
> <preferences name="com.sample.plugin">
> <preference name="samplepref1" value="$SAMPLE_PREF_1" />
> <preference name="samplepref2" value="$SAMPLE_PREF_2" />
> <preference name="samplepref3" value="$SAMPLE_PREF_3" />
> </preferences>
> </config-file>
> </platform>
> </plugin>
> Given the following preference configuration and default values PROVIDED
> the resultant config.xml file inside res/xml/config.xml (android example) contains all default values set to 'undefined'
> <preferences name="com.sample.plugin">
> <preference name="samplepref1" value="undefined" />
> <preference name="samplepref2" value="undefined" />
> <preference name="samplepref3" value="undefined" />
> </preferences>
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org