You are here

function comment_upload_filefield_paths_update in File (Field) Paths 6

Same name and namespace in other branches
  1. 5 modules/comment_upload.inc \comment_upload_filefield_paths_update()

Implements hook_filefield_paths_update().

File

modules/comment_upload.inc, line 83
Provides FileField Paths integration with the Comment Upload module.

Code

function comment_upload_filefield_paths_update($oid, $field) {
  $comment = _comment_load($oid);
  comment_invoke_comment($comment, 'view');

  // Flag files for update.
  if (isset($comment->files)) {
    foreach ($comment->files as &$file) {
      $file['new'] = TRUE;
    }
  }

  // Set Form ID.
  $comment->form_id = 'comment_form';

  // Process Comment.
  filefield_paths_comment((array) $comment, 'update');
}