23377 Posts in 18296 Topics by 2867 members
|Go to End|
21 August 2009 at 10:01pm
When creating a new assets folder in the Files & Images section, it is automatically created as Uploads/NewFolder/. When I then change the folder title and click save foldername, the URL field is not updated, and the fysical folder is still called 'NewFolder'. I then need to reload the section for the url field to be updated, so I can save it and actually change the fysical foldername.
I'm using 2.3.3. Can anyone maybe confirm this?
23 August 2009 at 1:38am Last edited: 23 August 2009 1:54am
It's weird - for some reason it now suddenly works fine. Don't want to know why, hope it stays that way
[EDIT] No, there's still a problem - it works fine in the default language, but it fails when the cms is set to a different language (tried several). Maybe something gets translated that shouldn't be?
23 August 2009 at 7:14am
Got it (a ticket exists): it's a little bug where you can't have spaces or other illegal characters in the default foldername. Quick fix: adapt the default folder name in /cms/lang/xx_XX.php (remove spaces):
$lang['xx_XX']['AssetAdmin']['NEWFOLDER'] = 'xxxxx';
Cause of the problem:
In cms/code/AssetAdmin.php - line 488, function AddFolder() the fysical folder is created first, after that the Folder object is created and written to database, in which process the foldername is sanitized, replacing spaces by '-'. The folder object now doesn't reflect the fysical folder. Fix: reverse the order and use the sanitized foldername to create the fysical folder
if(!$parentObj || !$parentObj->ID) $parent = 0;
// move creation of the folderobject
$p = new Folder();
$p->ParentID = $parent;
$p->Name = $p->Title = $name;
// use the folder's name to create the filename
if(isset($parentObj->ID)) $filename = $parentObj->FullPath . $p->Name();
else $filename = ASSETS_PATH . '/' . $p->Name();
|Go to Top|