arambalakjian / DataObject-as-Page

A SilverStripe module for displaying DataObjects as Pages
53 stars 27 forks source link

Can't use site tree after install.. #27

Closed surfjedi closed 11 years ago

surfjedi commented 11 years ago

I think I have uploaded module and installed properly onto an SS3.0.3 site.

But I can use or edit my site tree under the "pages" section at all after install. I can edit the dataobject, as data objects strangely.

here is my dataobject: <?php

class Project extends DataObjectAsPage { static $db = array( 'Name' => 'Text', 'Description' => 'Text' ); //The class of the page which will list this DataObject static $listing_class = 'ProjectHolderPage'; //Class Naming (optional but reccomended) static $plural_name = 'Projects'; static $singular_name = 'Project';

static $has_one = array(
    'Client' => 'Client',
    'Desktop1' => 'Image',
    'Desktop1' => 'Image',
    'Mobile1' => 'Image',
    'Mobile2' => 'Image',
    'Icon' => 'Image'   
);  

}

here is my listing page:

<?php class ProjectHolderPage extends DataObjectAsPageHolder {

} class ProjectHolderPage_Controller extends DataObjectAsPageHolder_Controller {

//This needs to know be the Class of the DataObject you want this page to list
static $item_class = 'Project';
//Set the sort for the items (defaults to Created DESC)
static $item_sort = 'Title ASC';

}

And here is my model admin:

<?php

class Project2Admin extends DataObjectAsPageAdmin { public static $managed_models = array('Project'); // Can manage multiple models static $url_segment = 'Projects2'; // Linked as /admin/products/ static $menu_title = 'Project Admin'; }

Any help on what Ive messed up?

Here are some of the error messages from the console:

GET http://www.berzerk.co.nz/admin/pages/listview 500 (Error at line 675 of /var/www/vhosts/berzerkdev.com/berzerk/framework/core/Object.php) jquery.js:8240 XHR finished loading: "http://www.berzerk.co.nz/admin/pages/listview". jquery.js:8240 GET http://www.berzerk.co.nz/admin/pages/treeview 500 (Error at line 675 of /var/www/vhosts/berzerkdev.com/berzerk/framework/core/Object.php) jquery.js:8240 XHR finished loading: "http://www.berzerk.co.nz/admin/pages/treeview". jquery.js:8240

arambalakjian commented 11 years ago

Hmm, not sure this has anything to do with the module, as it does not effect the site tree at all, it's all modeladmin/dataobject based.

Is that the only code you have in the site?

Aram