Hi,

Maybe our syntax is wrong, but the module doesn't save fields of nodes having CCK fields, for example, CCK named "field_test". The content type was named "test":

AS3 code: (works fine with Drupal6 module, but not with Drupal7 module)
sequence.add(new CallbackTask(_proxy.setRemoteCallId, "node.create"));
var node:Object = DrupalUtils.createNode("test", "test title", "test body");
node.field_test = new Array({value: "my test val"});
sequence.add(new DrupalInvokeTask(_proxy, "node", "create", node));

The node is created, but the CCK is empty.
What is the syntax for saving a CCK field in a node? is it a bug?
It doesn't work for us..

Thanks,
Guy.

Comments

rolf vreijdenberger’s picture

Hi Guy,

I'd try asking on the IRC channel for services on D7. It might be that field values are handled differently by services itself (different naming convention maybe), havent' checked it yet. Did you check with an http sniffer that the values are actually sent?

rolf vreijdenberger’s picture

I think you need to save custom fields in an array format see http://timonweb.com/how-programmatically-create-nodes-comments-and-taxon...
edit: ah, I see you did that already, maybe the language part?? (see link above)

guyzalon’s picture

Hi Rolf,
The values are being sent according to "Charles".
Its not only the CCK fields that are not being saved, its also the "Body" field of the node that is not being saved.
We need a solution urgently, is there a workaround? maybe using the REST services instead of AMF for saving nodes?
Thanks,
Guy.

guyzalon’s picture

Category: bug » support
Status: Active » Closed (fixed)

It works!
Thanks for the link!
AMFServer & Services work perfectly! it's not a bug.
The format is indeed more complicated in Drupal7 (3 nested Arrays!) - Language code is included.
Owe you few beers ;)
Thanks,
Guy.

kpedini’s picture

Guy,

Do you happen to have the syntax you used for saving a custom field in a node? I followed the link provided but I'm having trouble reverse engineering it in AS3. I too am having an issue saving to Body or custom fields.

Thanks,
Kevin