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, biapar, Willr, Ingo, swaiba, simon_w

Model Admin display bug?

Go to End

9 Posts   1890 Views


28 October 2010 at 7:02pm Community Member, 26 Posts

Hi Guys

I have tried to extend ModelAdmin and all seems ok until I click in the search option and the ctf looks like it is not loading its style sheet (image attached). I am running 2.4 and has tried this on 3 different servers and had the same result. Al with fresh installs.

if you have any ideas I would appreciate it. The weird thing is on the wamp server on my pc it is perfect!

thanks Craig


3 November 2010 at 1:39am Community Member, 56 Posts

Is this on the live site?


3 November 2010 at 6:45am Community Member, 26 Posts

Yes this is on the live site


3 November 2010 at 7:27pm Community Member, 56 Posts

Can you post the class that you have created?


3 November 2010 at 7:39pm (Last edited: 3 November 2010 7:41pm), Community Member, 26 Posts

3 files


   class VehicleAdmin extends ModelAdmin{
      static $managed_models = array ('Vehicle');
      static $url_segment = "trucks";   
      static $menu_title = "Trucks";

class Vehicle extends DataObject
   static $db = array(
   static $field_labels = array(
   "StockCode"=>"Stock Code",
   "Vin"=>"Vin Number",
   "Engine"=>"Engine Type",
   "Horsepower"=>"Engine Horsepower",   
   "Speedo"=>"Speedo Reading",
   "Tare"=>"Tare Weight",
   "Gvwrating"=>"GVW Rating",
   "Gcwrating"=>"GCW Rating",
   "Regnum"=>"Registration Number",
   "Regexpiry"=>"Registration Expiry",
   "Additional"=>"Addition Information",   
   "Cofexpiry"=>"COF Expiry",
   "Axelconfig"=>"Axel Configuration",
   "Rearaxels"=>"Rear Axels",
   "Suspension"=>"Rear Suspension",
   "Towingeye"=>"Towing Eye Size",
   "Roaduserkms"=>"Road User Kms",
   "Deck"=>"Deck Type & Length",
   "Drawbeamcert"=>"Drawbeam Cert Expiry",
   "Chassismod"=>"Chassis Mod Expiry",
   "Anchorage"=>"Load Anchorge Expiry",
   "Nzhbc"=>"NZHBC Compliance",
   "Kingpincert"=>"Kingpin Cert Expiry",
   "Fifthwheel"=>"5th Wheel Mount Cert",
   "Twistlocks"=>"Twist Locks Fitted/Cert",
   "Tyreinfo"=>"Tyre Information",
   "Tyrefront1"=>"Front 1",
   "Tyrefront2"=>"Front 2",
   "Tyrefront3"=>"Front 3",
   "Tyrefront4"=>"Front 4",
   "Tyrerear1"=>"Rear 1",
   "Tyrerear2"=>"Rear 2",
   "Tyrerear3"=>"Rear 3",
   "Tyrerear4"=>"Rear 4"
static $has_one = array();

static $has_many = array (
      'Photos' => 'Photo'
public function getCMSFields()

      $f = parent::getCMSFields();
      $manager = new ImageDataObjectManager(
         $this, // Controller
         'Photos', // Source name
         'Photo', // Source class
         'PhotoPic', // File name on DataObject
            'PhotoHeading' => 'Photo Heading',
            'PhotoText' => 'Photo Copy'
         ), // Headings
         'getCMSFields_forPopup' // Detail fields (function name or FieldSet object)
// Filter clause '`GalleryPageID` = '.$this->ID.''
         // Sort clause
         // Join clause
      return $f;

static $searchable_fields = array("Stockcode","Make","Model","Type");
static $summary_fields = array("Stockcode","Make","Model","Type");


class Photo extends DataObject{
static $db = array(
'PhotoHeading' =>'Text',
'PhotoText' =>'Text'
static $has_one = array(
'PhotoPic' => 'Image',
'Vehicle' => 'Vehicle'



3 November 2010 at 10:37pm Forum Moderator, 1796 Posts


A couple of notes...

1) an empty has_one is not required (only specify what you need)
2) in the case of summary_fields being the same as searchable_fields - you only need summary_fields
3) I'd remove almost all the code, dev/build, view, add items back in one by one to fix this

I cannot see the error right off, but I have had strange results from ModelAdmin and it can be a pain to find out what it was, but starting with a clean install and the smallest code and working up gets it working in the end?


4 November 2010 at 1:52am Community Member, 56 Posts


Try adding the following lines of codes to your VehicleAdmin.

public static $url_rule = '$Action/$ID';

public static $model_importers = null;

public function getModelImporters() {
      return null;

Then hit me back with the result.


4 November 2010 at 6:50am Community Member, 26 Posts

Hi Pinoy

No change at all in the results.


Go to Top