17488 Posts in 4473 Topics by 1978 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1423 Views |
-
Files & Images Administraction do not work after i extend image class

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) {
$gd->setQuality(90);
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?
-
Re: Files & Images Administraction do not work after i extend image class

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.
eg. http://www.mysite.com/admin?flush=1
also, try: http://www.mysite.com/db/build?flush=1 in case there's something missing.
Hopefully that should shed some light on the situation.
Cheers,
Sean -
Re: Files & Images Administraction do not work after i extend image class

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.
-
Re: Files & Images Administraction do not work after i extend image class

11 May 2007 at 11:20pm
I will fix it and tell you the results.
Thanks.
And Great Work with this CMS, and tanks to open it to the community.
-
Re: Files & Images Administraction do not work after i extend image class

12 May 2007 at 9:24am
Works Perfect Thanks.
| 1423 Views | ||
|
Page:
1
|
Go to Top |



