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.

DataObjectManager Module /

Discuss the DataObjectManager module, and the related ImageGallery module.

Moderators: martimiz, UncleCheese, Sean, biapar, Willr, Ingo, swaiba, simon_w

Only get "No Image Resources found" after server upgrade


Reply


2 Posts   541 Views

Avatar
sethx

Community Member, 2 Posts

19 November 2010 at 10:22am

Edited: 19/11/2010 11:23am

Hello,

I've finished upgrading my server to sebian squeeze, and some things are still broken-ish .

What still gets me is that i keep getting "<em>No Image Resources found</em>" when i select a folder from files on the server, and before i got a nice list of images.

I have run the "find new files and images" utility, i do get preview images within the "files and images" section, i've tried deleted the _resized folder and double checked that gd and imgmagick is enabled in php_info(), which it is, and made sure apache has read access, which it does.
Sitewise i have not changed a single thing since i started the upgrade process.

The best part, is that the dropdown menu which shows the folders actually tells me how many files are in that folder, but they never get displayed.
Existing pages which use this module simply show a default image instead of all the images now.

What else could i check?

The code i use to make a dataobjectmanager pop up is the following:

<?php
// /mysite/code/GalleryPage.php
class GalleryPage extends Page
{
static $has_many = array (
'Images' => 'ImageResource'
);
public static $db = array(
);
public static $has_one = array(
);

public function getCMSFields()
{
$f = parent::getCMSFields();
$manager = new ImageDataObjectManager(
$this, // Controller
'Images', // Source name
'ImageResource', // Source class
'Attachment', // File name on DataObject
array(
'Title' => 'Title',
'Caption' => 'Caption'
),
'getCMSFields_forPopup'
);
$f->addFieldToTab("Root.Content.Gallery",$manager);
return $f;
}
}

class GalleryPage_Controller extends Page_Controller {
}

Avatar
UncleCheese

Forum Moderator, 4092 Posts

20 November 2010 at 3:53am

Check the AttachmentID field on your ImageResource records and ensure those point to a valid ID in the File table.

Also, make sure the GalleryPageID on your ImageResource records points to a valid ID in the GalleryPage table.

--------------------
SilverStripe tips, tutorials, screencasts and more: http://www.leftandmain.com