5121 Posts in 1527 Topics by 1119 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1675 Views |
-
setAllowedExtensions and setFolderName

27 April 2009 at 2:22pm
Hi
I'm making a module and I'm trying to do the following:
----------------
function getCMSFields_forPopup() {
$CardImageField = new ImageField( 'CardImage' );
$CardImageField->setAllowedExtensions(array( 'png' ));
$CardImageField->setFolderName( 'flashcards' );$fields = new FieldSet();
$fields->push( new TextField( 'CardName' ) );
//$fields->push( new ImageField( 'CardImage' ) );
$fields->push( $CardImageField );
$fields->push( new TextField( 'CardContent' ) );
return $fields;
}
----------------I could see in an earlier thread that setAllowedExtensions() and setFolderName() does not work on ImageField. Is there any other way to do this?
Are there any plans about fixing it?
-
Re: setAllowedExtensions and setFolderName

15 August 2009 at 1:37am
To have a method documented in the API but not working is bad form - and not having any replies to this post either.
So, is it going to be fixed?
-
Re: setAllowedExtensions and setFolderName

16 August 2009 at 6:34pm
PeterB - I recommend posting this issue and a test case of what is broken on open.silverstripe.org (or there may even be an existing ticket - which in that case, do nothing).
Make sure you include the version of SilverStripe you are using and if you are not using trunk then you might want to download that and attempt it and see if it has been fixed in trunk.
-
Re: setAllowedExtensions and setFolderName

16 August 2009 at 7:30pm
I fixed these issues a while ago in trunk with a FileIFrameField & ImageField refactoring - however, these fixes are not available in the 2.3 branch.
-
Re: setAllowedExtensions and setFolderName

17 August 2009 at 7:52pm
How stable is trunk and is it ready for production use? Compatibility of modules would be a concern as my site's making heavy use of them.
Can I suggest that documentation (both normal and API docs) is versioned? That way it becomes clear what's usable in trunk and what's usable in the 'stable' 2.3 release. The Kohana team had this issue, and they've adopted a similar approach to Symfony & Doctrine with their documentation.
| 1675 Views | ||
|
Page:
1
|
Go to Top |



