Hi guys,

perhaps it would be nice for the next release of asset module, to make the automatic creation of directories configurable in the settings. There should be a choice, how user directories are named and if they are created automatically or not.

I'll explain, why I think so:

At the moment, directories are created with the usernames - for each user. Usernames can change, can have special characters or empty spaces in them. We experienced problems with updates and other modules because of that ... as some users register with their emailaddress ... and @ is not recommendable in filepaths. I think that directories like uid1 and uid2 would be better, like IMCE already does.

It was not comfortable for us, that each author creates his own directory. We manage lots of files with the asset module and prefer to sort them in directories like Video, Audio, images etc. and not peter lucas or annie. (Perhaps we should think about tagging the files ... which would also enhance the managment of files by this really great asset module! But that's an idea for the future far away ...)

As an immediate troubleshooter, I disabled the creation of directories by uncommenting a few lines:

in asset.module, on line 208

  /** As we disabled the creation of user directories, we disable as well the link to the My Assets dir
  if ($asset->type == 'directory' && $asset->dirname == '' && $asset->filename == $GLOBALS['user']->name) {
    $asset->title = t('My Assets');
  }
  */

and in asset_wizard.inc, on line 461

    /** Here are the directories created for each user ... we've simply disabled it because it's not useful for our case
    elseif (asset_check_directory($user->name, FILE_CREATE_DIRECTORY, NULL, array('parent' => '', 'title' => $user->name))) {
      $dir = $user->name;
    }
    */

This produces no errors as far as I have seen ... the wizard starts simply with the root directory instead of 'My Assets'. This is the case in asset module 5.x-1.0-rc2

Hope this is useful for someone

Comments

HansBKK’s picture

+1

Related - http://drupal.org/node/296858 and the other one I linked to from there as well

Ideally would allow the admin to set up default pathing based on tokens, as with Upload Path (and of course PathAuto) but NOT the way Imagefield does it (date tokens broken) - so the user can select a path if it's important to them, but otherwise it goes to a sensible location set by the admin (I like paths based on node-type and date myself, per-user is completely irrelevant to the site I'm currently working on)

wmostrey’s picture

Status: Active » Closed (won't fix)