You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by "Becky Gibson (JIRA)" <ji...@apache.org> on 2012/10/04 18:59:47 UTC

[jira] [Comment Edited] (CB-1566) SetMetaData on folder not working

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

Becky Gibson edited comment on CB-1566 at 10/5/12 3:59 AM:
-----------------------------------------------------------

The problem is the creation of the object that is passed in the options parameter. With the code in the example (http://stackoverflow.com/questions/3153969/create-object-using-variables-for-property-name) the key is actually set as "metadataKey" and not the value of the variable by that name.  See http://stackoverflow.com/questions/3153969/create-object-using-variables-for-property-name

this corrects it: 
var onGetDirectoryWin = function(parent) {
                    var dataObj = {};
                    dataObj[metadataKey] = metadataValue;
                    parent.setMetadata(onSetMetadataWin, onSetMetadataFail, dataObj);
                }

                
      was (Author: becka11y):
    The problem is the creation of the object that is passed in the options parameter. With the code in the example the key is actually set as "metadataKey" and not the value of the variable by that name.  See http://docs.phonegap.com/en/2.1.0/cordova_file_file.md.html#DirectoryEntry_setmetadata

this corrects it: 
var onGetDirectoryWin = function(parent) {
                    var dataObj = {};
                    dataObj[metadataKey] = metadataValue;
                    parent.setMetadata(onSetMetadataWin, onSetMetadataFail, dataObj);
                }


                  
> SetMetaData on folder not working
> ---------------------------------
>
>                 Key: CB-1566
>                 URL: https://issues.apache.org/jira/browse/CB-1566
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: iOS
>    Affects Versions: 2.1.0
>            Reporter: Peter Warren
>            Assignee: Shazron Abdullah
>
> Copied code from 2.1 docs (setFolderMetadata)
> http://docs.phonegap.com/en/2.1.0/cordova_file_file.md.html#Metadata
> console output "error setting metadata Error"
> Line 538 of CDVFile.m fails to retrieve attribute value even though the correct value was passed in to the (js)function call.
> NSDictionary* options= [command.arguments objectAtIndex:1 withDefault:nil]

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira