Download & Extend

Node.update ignores new files

Project:Services
Version:7.x-3.1
Component:Code
Category:support request
Priority:major
Assigned:Unassigned
Status:active

Issue Summary

Followed this to http://drupal.org/node/1354202 to add files with node.create. It works for me to create, but if I follow the same method for adding new files to my node on update, they will only be created (added to file_managed) but not connected to the node. But if I update title or description on an existing file it will be updated. It seems like you only can specify fid for the files when creating, not updating. It will skip those files.

It seems like the form_builder method strips the field_files from the new files when I do node.update?

Here is the array for the PUT. fid 185 was added one node.create and here I changed the title and the title for that file is updated. But the other file which is new for the update request, it is not added to the node when updated. Any ideas? Do I need to set a flag on the node or the field for it to store "new files"?

[field_files] => Array
(
  [und] => Array
  (
    [0] => Array
      (
        [fid] => 185
        [display] => 1
        [title] => My name
        [description] =>
      )
   
    [1] => Array
      (
        [fid] => 186
        [display] => 1
        [title] =>
        [description] => My description
      )
  )
)
nobody click here