Jump to:

1999 Posts in 1408 Topics by 613 members

Form Questions

SilverStripe Forums » Form Questions » Error Getting User Defined Form

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

Page: 1
Go to End
Author Topic: 2442 Views
  • Sophie
    Avatar
    Community Member
    33 Posts

    Error Getting User Defined Form Link to this post

    I've got a site built on 2.3.1. I installed the user defined forms module and created a three field contact form and named it "contact." When I attempt to test the form (I've tried in Draft and Live status) I receive an error.

    GET/contact/
    Website Error
    There has been an error
    The website server has not been able to respond to your request.

    I haven't a clue about where to go from here to get the form page to work. Any advice?

    Thanks!

  • Willr
    Avatar
    Forum Moderator
    5482 Posts

    Re: Error Getting User Defined Form Link to this post

    Turn on devmode so you can see the full error message. Add this to your mysite/_config.php file

    Director::set_environment_type("dev");

  • Sophie
    Avatar
    Community Member
    33 Posts

    Re: Error Getting User Defined Form Link to this post

    Now that it's in development mode, this is what it's telling me:

    Line 133 in /home/content/s/j/b/sjbmaine/html/markwright/sapphire/core/Object.php
    Source

    124
    125          } else if($config['function_str']) {
    126             $function = Object::$extraMethods[$this->class][strtolower($methodName)]['function'] = create_function('$obj, $args', $config['function_str']);
    127             return $function($this, $args);
    128
    129          } else {
    130             user_error("Object::__call() Method '$methodName' in class '$this->class' an invalid format: " . var_export(Object::$extraMethods[$this->class][$methodName],true), E_USER_ERROR);
    131          }
    132       } else {
    133          user_error("Object::__call() Method '$methodName' not found in class '$this->class'", E_USER_ERROR);
    134       }
    135    }
    136
    137    /**
    138     * This function allows you to overload class creation methods, so certain classes are
    139     * always created correctly over your system.

    Trace

    * Object::__call() Method 'setCustomValidationMessage' not found in class 'TextField'
    Line 133 of Object.php
    * Object->__call(setCustomValidationMessage,Array)
    * TextField->setCustomValidationMessage(Name is required)
    Line 208 of UserDefinedForm.php
    * UserDefinedForm_Controller->Form()
    Line 165 of UserDefinedForm.php
    * UserDefinedForm_Controller->index(HTTPRequest)
    Line 162 of Controller.php
    * Controller->handleAction(HTTPRequest)
    Line 107 of RequestHandler.php
    * RequestHandler->handleRequest(HTTPRequest)
    Line 122 of Controller.php
    * Controller->handleRequest(HTTPRequest)
    Line 28 of ModelAsController.php
    * ModelAsController->handleRequest(HTTPRequest)
    Line 277 of Director.php
    * Director::handleRequest(HTTPRequest,Session)
    Line 121 of Director.php
    * Director::direct(contact/)
    Line 115 of main.php

  • Willr
    Avatar
    Forum Moderator
    5482 Posts

    Re: Error Getting User Defined Form Link to this post

    ... Method 'setCustomValidationMessage' not found in class 'TextField'

    Make sure you are running SIlverStripe 2.3.2 and not anything earlier then this.

  • Sophie
    Avatar
    Community Member
    33 Posts

    Re: Error Getting User Defined Form Link to this post

    I've updated to 2.3.2 but that leads to another issue. When I attempt to login to the admin panel I receive this error message. Any advice? I should probably mention that I've used the automatic install and update available through GoDaddy.com.

    [User Error] Couldn't run query: SELECT Distinct Locale FROM SiteTree GROUP BY Locale Unknown column 'Locale' in 'field list'
    GET /admin

    Line 400 in /home/content/s/j/b/sjbmaine/html/markwright/sapphire/core/model/MySQLDatabase.php
    Source

    391    }
    392    
    393    function databaseError($msg, $errorLevel = E_USER_ERROR) {
    394       // try to extract and format query
    395       if(preg_match('/Couldn\'t run query: ([^\|]*)\|\s*(.*)/', $msg, $matches)) {
    396          $formatter = new SQLFormatter();
    397          $msg = "Couldn't run query: \n" . $formatter->formatPlain($matches[1]) . "\n\n" . $matches[2];
    398       }
    399       
    400       user_error($msg, $errorLevel);
    401    }
    402 }
    403
    404 /**
    405 * A result-set from a MySQL database.
    406 * @package sapphire

    Trace

    * Couldn't run query: SELECT Distinct Locale FROM SiteTree GROUP BY Locale Unknown column 'Locale' in 'field list'
    Line 400 of MySQLDatabase.php
    * MySQLDatabase->databaseError(Couldn't run query: SELECT Distinct Locale FROM SiteTree GROUP BY Locale | Unknown column 'Locale' in 'field list',256)
    Line 102 of MySQLDatabase.php
    * MySQLDatabase->query(SELECT Distinct Locale FROM SiteTree GROUP BY Locale,256)
    Line 120 of DB.php
    * DB::query(SELECT Distinct Locale FROM SiteTree GROUP BY Locale)
    Line 426 of SQLQuery.php
    * SQLQuery->execute()
    Line 1133 of Translatable.php
    * Translatable::get_existing_content_languages(SiteTree)
    Line 1204 of CMSMain.php
    * CMSMain->MultipleLanguages()
    * call_user_func_array(Array,Array)
    Line 550 of ViewableData.php
    * ViewableData->cachedCall(MultipleLanguages,,)
    Line 591 of ViewableData.php
    * ViewableData->hasValue(MultipleLanguages)
    Line 313 of .cache.home.content.s.j.b.sjbmaine.html.markwright.cms.templates.Includes.CMSMain_left.ss
    * include(/tmp/silverstripe-cache-home-content-s-j-b-sjbmaine-html-markwright/.cache.home.content.s.j.b.sjbmaine.html.markwright.cms.templates.Includes.CMSMain_left.ss)
    Line 354 of SSViewer.php
    * SSViewer->process(CMSMain)
    Line 773 of ViewableData.php
    * ViewableData->renderWith(Array)
    Line 480 of LeftAndMain.php
    * LeftAndMain->Left()
    * call_user_func_array(Array,Array)
    Line 408 of ViewableData.php
    * ViewableData->XML_val(Left,,1)
    Line 59 of .cache.home.content.s.j.b.sjbmaine.html.markwright.cms.templates.LeftAndMain.ss
    * include(/tmp/silverstripe-cache-home-content-s-j-b-sjbmaine-html-markwright/.cache.home.content.s.j.b.sjbmaine.html.markwright.cms.templates.LeftAndMain.ss)
    Line 354 of SSViewer.php
    * SSViewer->process(CMSMain)
    Line 175 of Controller.php
    * Controller->handleAction(HTTPRequest)
    Line 129 of RequestHandler.php
    * RequestHandler->handleRequest(HTTPRequest)
    Line 122 of Controller.php
    * Controller->handleRequest(HTTPRequest)
    Line 277 of Director.php
    * Director::handleRequest(HTTPRequest,Session)
    Line 121 of Director.php
    * Director::direct(/admin)
    Line 118 of main.php

  • rbquirke
    Avatar
    Community Member
    70 Posts

    Re: Error Getting User Defined Form Link to this post

    try running a database build by putting: /dev/build on the end of your website address and see how you go with that.

  • Sophie
    Avatar
    Community Member
    33 Posts

    Re: Error Getting User Defined Form Link to this post

    I did that right away and received the same error. When I read your note I thought to go back and flush it and all is well now. Thank you both!

    Sophie

    2442 Views
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.