drupal-ios-sdk-example icon indicating copy to clipboard operation
drupal-ios-sdk-example copied to clipboard

Empty Body

Open magtak opened this issue 13 years ago • 8 comments

Apart from a minor bug in the IBOUtlet connections which i fixed (basically the textboxes were mixed up - no biggy) I can't seem to add body to my article.

Site config is 7.x w/ Services 3.x. Any ideas?

magtak avatar Dec 20 '11 10:12 magtak

Are you positive you have the 7.x version of the code checked out?

kylebrowning avatar Dec 20 '11 18:12 kylebrowning

If it's only the lines in DIOSNode, yes :)

magtak avatar Dec 21 '11 07:12 magtak

How are you setting the body? Its not, its also the code in the NodeViewController

kylebrowning avatar Dec 21 '11 07:12 kylebrowning

Eh.. that's what i meant - NodeViewController. Those are the lines I uncommented. (Can't see any lines that need uncommenting in DIOSNode - just checking if by mistake i figured it out myself). I am setting the body both via the UI and also tried hardcoding it. The article is succesfully submitted, with the correct title, sometimes the correct user (it's anonymous sometimes) but never an article body.

magtak avatar Dec 21 '11 07:12 magtak

one thing I don't quite get and might be the problem is the appearance of these 2 lines of code in NodeViewController:

[nodeData setObject:languageDict forKey:@"body"]; [nodeData setObject:[bodySaveField text] forKey:@"body"];

setting 2 different values for the "body" key? Am i missing something in your - other than that - awesome code? :)

magtak avatar Dec 21 '11 07:12 magtak

also, just noticed that in the site's content the language for the aforementioned article is "Undefined language ()" whereas the others are "Language Neutral" in case that helps somehow.

magtak avatar Dec 21 '11 08:12 magtak

If you look at how the array is formed in PHP you'll see how it needs to be sent. I think I'm going to fix this in future versions of DIOSSDK

saveNode, should handle everything you need it to, but for fields its always different based on the field type.

The SDK needs a way to pass a value and a field type and get back the correct object structure in C, but I havnt gotten around to doing that and figured for now just building the array like it needs to be done is the easiest.

kylebrowning avatar Dec 21 '11 23:12 kylebrowning

were you able to reproduce btw?

magtak avatar Dec 23 '11 10:12 magtak