23377 Posts in 18296 Topics by 2867 members
Page: 1 2
|Go to End|
8 January 2010 at 2:16pm Last edited: 28 January 2010 9:17am
As pointed out here, due to a bug it is not possible to upload images to a custom folder with ImageField.
This will be fixed in SS2.4.0. But SS2.4.0 is just in it's first alpha-fase, so it is likely we have to be patient before the stable can be downloaded.
That's why I created this module. It is heavily based on http://svn.silverstripe.com/open/phpinstaller/branches/2.4/ Revision 96438
To use this module:
- install the module in the normal way
- call either NewImageField or NewIFrameField like you're calling any other fieldtype
- the attributes are the same as for ImageField and IFrameField in SS2.3.x
This module is useful as long as you're using SS2.3.x
Though it shouldn't break, I'd strongly recommend you to rewrite your code in order to use the built-in IFrameField and ImageField as soon as you start updating your productionsite(s) to SS2.4.
EDIT: grmbl it seems the module won't be working in DOM. So if you're uploading through (F/I)DOM, you have to stick to the old FileIFrameField or ImageField with all their flaws
7 July 2010 at 8:28pm
Thanks theAlien for the Module. It helped me a lot.
But I had difficulties choosing existing files from a subfolder in assets:
sapphire\forms\TreeDropdownField.php line 90: Can't find database record Image with ID = xxx
Changing the last Argument to 'File' in line 130 in NewIFrameField.php solved the problem:
$fileSources["existing//$selectFile"] = new TreeDropdownField('ExistingFile', '', 'File');
Page: 1 2
|Go to Top|