Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

silverstripe 2.4 upgrade problem

Go to End

7 Posts   1783 Views


Community Member, 90 Posts

25 May 2010 at 2:45pm

Hey, guys. i met a very strange problem with 2.4 ImageField.
I upgraded a site from 2.3.6 to 2.4, imported the whole database and copy the whole assest folder.
Then, the problem came out.
It happnes on ImageField-[Replace Image], if you click the radio button [from the File Store] and select any image from the local file store and click the[replace]. This image will not be found in File Store anymore. I dont know why it act like this.
The imge is there on the asset folder but just cannot see in File Store through the ImageField anymore....
Anyone knows the solution to the problem?!
Thanks in advanced..


Community Member, 90 Posts

25 May 2010 at 3:55pm

Stop spaming Zatarsales04.... this doesnt help at all.


Community Member, 90 Posts

25 May 2010 at 5:08pm

i was doing heaps of testing on this problem. and also simulated a similar enviroment to make sure that wont have the same problem.

I have found the 2.4 verison has the problem. The eariler versions are good..

The new discovery was found :

It will be fine if i use:

public static $has_one=array(

Directly refer the Generic Image Class.

but will be problem if i use MyImage class extends Image Class
So,if i do something like
public static $has_one=array(
This problem happens.

For your interests, the code in my MyImage Class is :

class MyImage extends Image{

public function generateHomeProductImage($gd) {
return $gd->croppedResize(285,150);

public function generateHomeSpotLightImage($gd)
return $gd->croppedResize(485,212);



Anyone know whats going on here?!


Community Member, 90 Posts

28 May 2010 at 3:22pm

I have encounterred lots of problem in ImageFiled and Image.php file.

I am not sure is there anything changes on 2.4. it seems the Image class cannot be extended to be customized(MyImage) anymore. It will always bring lots of problems when i was using MyImage to extend Image and adding the croppedresize function for MyImage.

I have also noticed the tutorial has been updated about the ImageField @ "recipes/imageupload.txt • Last modified: 2010/05/05 23:38 "

However, it doesn't mention the CustomizedImage can be applied to extend the Base Image Class as a another .php file in the mysite folder.

It seems the silverstripe team encourage developer to separate the corppedresize function into the /mysite/xxxx.php code after Page_Controller instead.

Not sure what’s going on THIS area. But really knee to know whether is anything wrong with my code or the traditional routine cannot be applied anymore?!



Community Member, 48 Posts

12 June 2010 at 1:38am

Hi there Alex.

There's a filter in the TreeDropdownField that only displays objects of type 'Folder' or 'Image'.

This patch: will also display any objects that are a subclass of 'Image'.

Keep the faith,

Barry :-P


Community Member, 90 Posts

12 June 2010 at 11:51pm

Thanks for the ticket, seems we met the same problem with using the same image class to dealing with ImageField problem.
Thanks for pointing out the the filter can only filter "Image" class.
Everything extends Image cannot be found out using ImageField (upload from file store).
Keep the status up.
Would like to see solution soon.

We need to catch up in real life.



Community Member, 182 Posts

14 June 2010 at 9:29pm

Good patch many thanks!
Really helped me as the image did not appear in ImageGallery "Replace Image > From the File Store" only folders.