21311 Posts in 5739 Topics by 2604 members
|Go to End|
13 February 2010 at 2:40pm
So in the CMS if I have a photo uploaded, I can "replace with one from my computer"
Can this be done with Files? For example, if I update a file (say a form). Shouldnt there be an option to replace the file? I cant seem to make this happen.
Any thoughts? Am I missing something? I do have Uncle Cheese's DOM installed. Maybe something there?
4 April 2010 at 4:48pm Last edited: 4 April 2010 4:52pm
I can see that the File class has updateLinks() http://api.silverstripe.org/default/File.html#updateLinks - but can't find any way to update the actual filesystem file via the Files & Images admin and then fire off this updateLinks() for the selected File entry in the db.
Once an admin has a bunch of links everywhere directed to a particular File, if they need to update the pdf (for example) they have to upload a new File via the admin and then go to all the pages referring to the old File and change the links.. ? That can't be right can it?
What have I missed?
14 April 2010 at 4:42pm
Still nothing on this?
14 April 2010 at 5:10pm
This functionality is part of the versioned files module - you can grab it from http://github.com/ajshort/silverstripe-versionedfiles. In the Filest & Images area, when you click on the edit button for a file a new Replace tab will show up.
14 April 2010 at 8:38pm
Outstanding! Thanks ajshort, I'll be giving this a go very shortly. Do you know if it's 2.4rc1 compatible?
16 April 2010 at 2:36am
I'm getting a few errors, firstly after /dev/build/ I tried to run /dev/tests/ but got
[Warning] copy(/path/to/website/root/www/assets/Uploads/_versions/12/Kids-2B1.ssets/uploads/kids-2b): failed to open stream: No such file or directory
And if I now try to open the Files & Images Admin I get
[User Error] FieldSet::addFieldToTab() Tried to add a tab to object 'FieldSet' - 'BottomRoot' didn't exist.
eek! I'm running close to if not the latest 2.4. Any suggestions?
16 April 2010 at 2:44am
Ah, the first error was the result of that file not actually having an extension in its filename in the db.
Still getting the error relating to the BottomRoot tab not existing though. Going hunting now, but any suggestions welcome.
16 April 2010 at 2:55am
Unfortunately for my current timelines this appears a little too buggy out of the box.
Removed the no-extension file and changed references to "BottomRoot" tab to "Root" tab but then got the following when viewing a File and trying to replace it:
Viewing the file, versions drop down screenshot is attached.
Replacing the file,
[User Notice] Upload::setAllowedExtensions() is deprecated. Please use Upload_Validator::setAllowedExtensions() instead
Happy to help with some testing along the way but I can't use it in production just yet.
|Go to Top|