Skip to content


Subversion checkout URL

You can clone with
Download ZIP


TreeDropDownField in Widgets - CMS error #2906

ellecarrier opened this Issue · 4 comments

4 participants


I'd like to set a Linked Page from within a Widget in the CMS...

Using the following in getCMSFields()

TreeDropdownField::create('LinkedPageID', 'LinkedPage', 'SiteTree')

Is causing this error:

Fatal error: Call to a member function FormAction() on a non-object in /public_html/framework/forms/FormField.php on line 161

Any ideas?

I've used the same kind of code outside of widgets, in pages, and of course is works fine.



What version of CMS and framework are you using


Tried the following code on the latest version of CMS and framework which is 3.13 and it worked OK for me.
Would you be able to provide us with the code you are using?

class Page extends SiteTree {

        private static $db = array(
                'LinkedPageID' => 'Int'

        private static $has_one = array(

        public function getCMSFields() {
                $fields = parent::getCMSFields();
                $linkedPage = TreeDropdownField::create('LinkedPageID', 'LinkedPage', 'SiteTree');
                return $fields;

class Page_Controller extends ContentController {

         * An array of actions that can be accessed via a request. Each array element should be an action name, and the
         * permissions or conditions required to allow the user to access it.
         * <code>
         * array (
         *     'action', // anyone can access this action
         *     'action' => true, // same as above
         *     'action' => 'ADMIN', // you must have ADMIN permissions to access this action
         *     'action' => '->checkAction' // you can only access this action if $this->checkAction() returns true
         * );
         * </code>
         * @var array
        private static $allowed_actions = array (

        public function init() {
                // You can include any CSS or JS required by your project here.
                // See:


Thanks Christopher
@ellecarrier would be good to close this issue as it seems to be a duplicate of

@simonwelsh simonwelsh added the 3.1 label
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.