We use the latest amfphp to load and save nodes from a flex application. Unfortunatelly node references and user references which are loaded correctly are not set after saving the node from flex. Another cck text field gets updated correctly.
The content type is set up as follows:
Editor field_editor User Reference
Journal field_journal Node Reference
JournalStructure field_journalstructure Text
The node before the update:
Editor
Editor
Journal
eJournal - Das Team
JournalStructure
<?xml version="1.0" encoding="UTF-8"?> äöü
The node after the update:
Editor
Journal
JournalStructure
<?xml version="1.0" encoding="UTF-8"?> äöü
The code in flex:
private function getRelease() : void {
this.node_load.load(this.releaseNodeId);
}
public function onLoaded(event:ResultEvent):void {
this.release = event.result;
this.journalStructure = release.field_journalstructure[0].value;
}
private function saveStructure() : void {
release.field_journalstructure[0].value = textarea.text;
node_save.save(release);
}
I checked in the flex debugger that the values in the release object are set before I call save. Seems to get lost somewhere further down.
Any hints where to investigate further are welcome!
Kind regards
Uwe
Comments
Comment #1
uwej commentedI realized now that only fields supplied during save are updated, so I have a workaround for this problem. Anyway If somebody knows a solution that would be great.
Comment #2
cdraptor commentedI may be able to help. Here is what I found
Doing a node load on a CCK int field that I have in one of my nodes
[field_placeid] => Array
(
[0] => Array
(
[value] => 9
)
What I did to save this in Flex is:
var edit:Object = new Object;
var fromDate:Date = new Date(2007,10,10,5,0,0,0);
var toDate:Date = new Date(2007,10,10,6,0,0,0);
edit.type = "event";
edit.title = "HELP ME";
edit.body = "trying to get the event times to save - why doesn't it";
edit.uid = 2;
edit.name = "cdurham";
// Here I set edit.(field_placeid) my CCK field, then I create a new Array with "value" assoc array to 9, worked wonderful
edit.field_placeid = new Array({value:9});
//some data I wanted to leave empty, maybe this isn't needed
edit.field_time = new Array();
edit.locations = new Array();
edit.location = new Array();
Hope this helps
eventnode.save(edit);
Comment #3
dsgirard commentedawesome, exactly what I was looking for!
Comment #4
snelson commentedComment #5
leoman_730 commentedHave you tried to save another type of cck field? Such as select field, I am using the same method as describe above, I was able to save any cck textfield, but that not work for any select field.
Any idea?
Comment #6
bigbaykiter commentedI am also trying to save a 'select field' ? no luch either :(
Comment #7
alan d. commentedNode references probably need nid instead of value/ User references uid.Otherwise the array is the same.
I have not tested this so report back if it works or crashes badly ;]
Comment #8
seanmclucas commentedYeah I'm still having an issue with dynamically creating nodes that have cck fields with radio buttons, check, boxes, multi-select lists, etc. Node reference CCK fields don't work since they are a multi-select list in this case.
Of course the title, type, status, etc work. None of the CCK fields do if they are a select-list or checkboxes, etc. Plain text CCK fields import just fine.
I even tried things like "nid" instead of "value" but that didn't work either.
Comment #9
josys64 commentedHi everybody,
I try desperatly to fix an issue from my installation.
i can't get all data from my view, especially CCK field:
- view name : "recipes_all" and i get these data when i test in Drupal services :
In flex (for my test i didn't specify any field):
and trace show me this :
if someone have any idea ?
thanks
Comment #10
Johannes De Boeck commentedtry this:
http://drupal.org/node/305155
Comment #11
josys64 commentedyes, it's worked fine.
thanks