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.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

Archive /

Our old forums are still available as a read-only archive.

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

Files & Images Administraction do not work after i extend image class

Go to End

5 Posts   1872 Views


Community Member, 41 Posts

11 May 2007 at 12:18pm

Hi here is my code in Producto.php, is a little change from the "extend a basic site" tutorial. (staff part)

class Producto extends Page {
static $db = array(
static $has_one = array(
'Foto' => 'ProductPage_Image'

function getCMSFields() {
$fields = parent::getCMSFields();

$fields->addFieldToTab("Root.Content.Images", new ImageField('Foto'));
return $fields;

class Producto_Controller extends Page_Controller {


class ProductPage_Image extends Image {
function generateThumbnail(GD $gd, $width, $heigth) {
return $gd->paddedResize($width,$heigth,"F0F0F0");

public function Thumbnail($width)
return $this->getFormattedImage('Thumbnail',$width, 70);

i create a few page of this type and add images to every product.
All this works perfect in live site, Thumbnail are created perfect.

But in CMS when click "Files & Images" i get : Fatal error: Class 'ProductPage_Image' not found in D:\...\sapphire\core\model\DataObject.php on line 1096

Why i get this error?


Forum Moderator, 922 Posts

11 May 2007 at 2:07pm

Have you tried entering the admin panel doing ?flush=1 at the end of the URL? Perhaps there is some caching somewhere.


also, try: in case there's something missing.

Hopefully that should shed some light on the situation.



Administrator, 690 Posts

11 May 2007 at 3:48pm

The class ProductPage_Image *must* be in a file called ProductPage.php

If you want to put it into Producto.php, you should rename the class to Prodocto_Image. If you do this, remember to run db/build, and then edit the current images in the database, changing the File.ClassName field.


Community Member, 41 Posts

11 May 2007 at 11:20pm

I will fix it and tell you the results.


And Great Work with this CMS, and tanks to open it to the community.


Community Member, 41 Posts

12 May 2007 at 9:24am

Works Perfect Thanks.