Jump to:

7940 Posts in 1543 Topics by 946 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » Error Missing Argument

Discuss the DataObjectManager module, and the related ImageGallery module.

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

Page: 1
Go to End
Author Topic: 1371 Views
  • pinkp
    Community Member
    168 Posts

    Error Missing Argument Link to this post

    I have this error when extending ImageGallery, I'm sure its something simple but I just can't work it out!! help appreciated, thanks
    It happens when I try and add the pagetype in the CMS.

    "ERROR [Warning]: Missing argument 1 for ImageGalleryPage::getCMSFields(), called in /home/sites/mysite.co.uk/public_html/mysite/code/MyImageGalleryPage.php on line 17 and defined
    IN POST /admin/getitem?ID=20&ajax=1
    Line 106 in /home/sites/mysite.co.uk/public_html/image_gallery/code/ImageGalleryPage.php"

    I'm trying to add two image fields to my 'images' tab it worked in MAMP but not live...

    This is my MyImageGallery.php

    class MyImageGalleryPage extends ImageGalleryPage {
    protected $itemClass = "MyImageGalleryItem";

    static $icon = "themes/shop/images/treeicons/gallery";

    static $db = array(

    static $has_one = array(
       'GalleryButtonImage' => 'Image',
       'GalleryButtonImage2' => 'Image'

    function getCMSFields(){
        $f = parent::getCMSFields();
    $f->addFieldToTab("Root.Content.Images", new ImageField('GalleryButtonImage','Button Image'));
        $f->addFieldToTab("Root.Content.Images", new ImageField('GalleryButtonImage2','Button Image Roll Over'));
    return $f;

    class MyImageGalleryPage_Controller extends ImageGalleryPage_Controller {


  • UncleCheese
    4085 Posts

    Re: Error Missing Argument Link to this post

    Use getCMSFields($cms);

Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.