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.

Upgrading SilverStripe /

Ask questions about upgrading SilverStripe to the latest version.

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

userdefinedform on 2.4 stable


Go to End
Reply


15 Posts   2734 Views

Avatar
webtonic

Community Member, 26 Posts

21 May 2010 at 4:43pm

I have installed and when try to change page type to user form, (save and publish) receive error "Error saving Content" and page will not save.

Avatar
Willr

Forum Moderator, 5513 Posts

21 May 2010 at 8:18pm

Make sure you use a daily build (or trunk) of UserForms. 0.2 is not compatible with it. We will be releasing a stable 0.3 build of UDF for 2.4 compatibility in the coming weeks.

If you are using trunk make sure you have rebuilt the database.

Avatar
webtonic

Community Member, 26 Posts

21 May 2010 at 8:31pm

Thanks Will - made no difference. Will have to wait for stable build 0.3

Avatar
Willr

Forum Moderator, 5513 Posts

21 May 2010 at 8:34pm

Can you open up firebug if you have it installed and view the console panel when you get the error - it should output a more useful one. No tickets currently exist about creating a field and I can do it successfully so its likely somethings up in your environment.

Avatar
webtonic

Community Member, 26 Posts

21 May 2010 at 9:19pm

Hi Will - firebug error

ERROR [User Error]: Couldn't run query:
INSERT INTO "EditableFormField_versions" ("ClassName", "Created", "LastEdited", "Name", "Title", "Sort", "Required", "CanDelete", "ParentID", "Default", "CustomErrorMessage", "CustomRules", "CustomSettings", "CustomParameter", "Version", "RecordID", "AuthorID") VALUES ('EditableTextField', '2009-06-20 19:55:43', '2010-05-21 21:17:24', 'EditableTextField1', 'Name', 0, '1', '1', 3, null, null, null, null, null, 1, 1, 1)

Unknown column 'CustomParameter' in 'field list'
IN POST /admin/EditForm
Line 536 in /home/stagton/public_html/sapphire/core/model/MySQLDatabase.php

Source
======
527:    }
528:    
529:    function databaseError($msg, $errorLevel = E_USER_ERROR) {
530:       // try to extract and format query
531:       if(preg_match('/Couldn\'t run query: ([^\|]*)\|\s*(.*)/', $msg, $matches)) {
532:          $formatter = new SQLFormatter();
533:          $msg = "Couldn't run query: \n" . $formatter->formatPlain($matches[1]) . "\n\n" . $matches[2];
534:       }
535:       
* 536:       user_error($msg, $errorLevel);
537:    }
538:    
539:    /**
540:     * Return a boolean type-formatted string
541:     *
542:     * @param array $values Contains a tokenised list of info about this data type

Trace
=====
<ul>user_error(Couldn't run query:
INSERT INTO "EditableFormField_versions" ("ClassName", "Created", "LastEdited", "Name", "Title", "Sort", "Required", "CanDelete", "ParentID", "Default", "CustomErrorMessage", "CustomRules", "CustomSettings", "CustomParameter", "Version", "RecordID", "AuthorID") VALUES ('EditableTextField', '2009-06-20 19:55:43', '2010-05-21 21:17:24', 'EditableTextField1', 'Name', 0, '1', '1', 3, null, null, null, null, null, 1, 1, 1)

Unknown column 'CustomParameter' in 'field list',256)
line 536 of MySQLDatabase.php

MySQLDatabase->databaseError(Couldn't run query: INSERT INTO "EditableFormField_versions" ("ClassName", "Created", "LastEdited", "Name", "Title", "Sort", "Required", "CanDelete", "ParentID", "Default", "CustomErrorMessage", "CustomRules", "CustomSettings", "CustomParameter", "Version", "RecordID", "AuthorID") VALUES ('EditableTextField', '2009-06-20 19:55:43', '2010-05-21 21:17:24', 'EditableTextField1', 'Name', 0, '1', '1', 3, null, null, null, null, null, 1, 1, 1) | Unknown column 'CustomParameter' in 'field list',256)
line 134 of MySQLDatabase.php

MySQLDatabase->query(INSERT INTO "EditableFormField_versions" ("ClassName", "Created", "LastEdited", "Name", "Title", "Sort", "Required", "CanDelete", "ParentID", "Default", "CustomErrorMessage", "CustomRules", "CustomSettings", "CustomParameter", "Version", "RecordID", "AuthorID") VALUES ('EditableTextField', '2009-06-20 19:55:43', '2010-05-21 21:17:24', 'EditableTextField1', 'Name', 0, '1', '1', 3, null, null, null, null, null, 1, 1, 1))
line 583 of Database.php

SS_Database->manipulate(Array)
line 139 of DB.php

DB::manipulate(Array)
line 1048 of DataObject.php

DataObject->write()
line 494 of Versioned.php

Versioned->publish(Stage,Live,)

call_user_func_array(Array,Array)
line 693 of Object.php

Object->__call(publish,Array)

EditableTextField->publish(Stage,Live,)
line 90 of EditableFormField.php

EditableFormField->doPublish(Stage,Live)
line 129 of UserDefinedForm.php

UserDefinedForm->doPublish()
line 769 of LeftAndMain.php

LeftAndMain->save(Array,Form,SS_HTTPRequest)
line 296 of Form.php

Form->httpSubmission(SS_HTTPRequest)
line 134 of RequestHandler.php

RequestHandler->handleRequest(SS_HTTPRequest)
line 152 of RequestHandler.php

RequestHandler->handleRequest(SS_HTTPRequest)
line 147 of Controller.php

Controller->handleRequest(SS_HTTPRequest)
line 283 of Director.php

Director::handleRequest(SS_HTTPRequest,Session)
line 127 of Director.php

Director::direct(/admin/EditForm)
line 127 of main.php

</ul>

Avatar
Willr

Forum Moderator, 5513 Posts

21 May 2010 at 9:25pm

Ah ok known bug - http://doc.silverstripe.org/upgrading:2.4.0?s[]=upgrading#user-defined_forms.

To fix that login to your database (phpmyadmin usually) and select the EditableFormField table in your database. Click the structure button and hit delete on the CustomParameter field.

Avatar
webtonic

Community Member, 26 Posts

21 May 2010 at 9:33pm

thanks this has fixed the saving error - the page type does not change to a user defined form it stays as Site Tree! with no form options showing

Avatar
Willr

Forum Moderator, 5513 Posts

21 May 2010 at 9:39pm

Hmm run a /dev/build again, flush the cms - admin?flush=1 and try to change the pagetype again. Create a new UDF and see if that works.

Go to Top