I Found this entry http://drupal.org/node/330421

Yet it does not seem to be assigning the path the way filefield paths is setup and when used through the default form method.

Any ideas please?

Comments

giorgio79’s picture

Ah I think I figured it out:

$node = filefield_paths_update($nid, $field_name);
node_save($node);

Will try it now.

giorgio79’s picture

Status: Active » Fixed

This was it
$node = filefield_paths_node_update($row["nid"]);

Massively fantastic :)

The file was not even in the files folder, just some random folder on the server...

Great module.

deciphered’s picture

Hi giorgio79,

Glad I could be of assistance :)
Seriously though, thanks for supplying your solution, that will help anyone else with a similar query.

Cheers,
Deciphered.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

sinasalek’s picture

As i understand $node object should be passed as argument rather than its id, although if you're using node_save you don't really need to call this, filefield_path gets call on node save automatically

/**
 * Implements hook_node_update().
 */
function filefield_paths_node_update(&$node) {
  if (($ffp = filefield_paths_get_fields($node)) !== FALSE) {
  ...

Also if you're using node_save you should pass filefield items likes the following code, otherwise it doesn't

$node['myfile_field'][0]['data']['process']=true;//workaroudn for getting filefield_paths_node_update to work