Skip to content

Commit

Permalink
Take out condition for token module. (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
herbdool authored and laryn committed Sep 25, 2018
1 parent e0a54d3 commit 65e323f
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions sources/attach.inc
Expand Up @@ -64,12 +64,10 @@ function filefield_source_attach_settings($op, $instance) {
'#maxlength' => 128,
'#description' => t('The directory within the <em>File attach location</em> that will contain attachable files.'),
);
if (module_exists('token')) {
$return['source_attach']['tokens'] = array(
'#theme' => 'token_tree',
'#token_types' => array('user'),
);
}
$return['source_attach']['tokens'] = array(
'#theme' => 'token_tree',
'#token_types' => array('user'),
);
$return['source_attach']['absolute'] = array(
'#type' => 'radios',
'#title' => t('File attach location'),
Expand Down Expand Up @@ -296,9 +294,7 @@ function _filefield_source_attach_directory($instance, $account = NULL) {
// Replace user level tokens.
// Node level tokens require a lot of complexity like temporary storage
// locations when values don't exist. See the filefield_paths module.
if (module_exists('token')) {
$path = token_replace($path, array('user' => $account));
}
$path = token_replace($path, array('user' => $account));

return $absolute ? $path : file_default_scheme() . '://' . $path;
}

0 comments on commit 65e323f

Please sign in to comment.