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.

All other Modules /

Discuss all other Modules here.

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

user defined form - cannot add fields


Go to End
Reply


9 Posts   960 Views

Avatar
jwill123

Community Member, 5 Posts

15 February 2013 at 7:53am

Edited: 15/02/2013 9:08am

I installed the user defined forms on 3.03 and can add a new page (User Defined Form), but do not see the form tabs that allow me to add form fields.

Update - after doing a flush-all, I see the tabs now, now I cannot add a field. I get "There has been an error".

Avatar
Willr

Forum Moderator, 5513 Posts

16 February 2013 at 1:16pm

Check your browser XHR section (or your php error log) for the actual error message and backtrace.

If you're using Chrome then this is found under 'Web Inspector' => 'Network' => 'XHR' then try add again.

Avatar
jwill123

Community Member, 5 Posts

17 February 2013 at 2:47am

Thanks for the response, I get the attached reply.

Attached Files
Avatar
Willr

Forum Moderator, 5513 Posts

17 February 2013 at 9:09am

1) Turn on dev mode
2) Try again

Avatar
jwill123

Community Member, 5 Posts

17 February 2013 at 10:07am

I see the attached error.

Attached Files
Avatar
Willr

Forum Moderator, 5513 Posts

17 February 2013 at 10:10am

Great so now open up that line (that only shows that a request failed, not why) and look at the Response tab to see the back trace.

Avatar
jwill123

Community Member, 5 Posts

17 February 2013 at 10:14am

ERROR [User Error]: Couldn't run query:
INSERT INTO "EditableFormField_versions" ("Required", "CustomRules", "CustomSettings", "Default", "CustomErrorMessage", "LastEdited", "ClassName", "Created", "Name", "Title", "Sort", "CanDelete", "CustomParameter", "ParentID", "Version", "RecordID", "AuthorID") VALUES ('1', 'a:0:{}', 'a:6:{s:10:\"ExtraClass\";s:0:\"\";s:10:\"RightTitle\";s:0:\"\";s:9:\"MinLength\";s:0:\"\";s:9:\"MaxLength\";s:0:\"\";s:4:\"Rows\";s:1:\"1\";s:10:\"ShowOnLoad\";s:4:\"Show\";}', null, null, '2013-02-16 15:12:26', 'EditableTextField', '2008-11-03 10:10:51', 'EditableTextField1', '*First Name:', '0', '1', null, '81', 1, 1, 2)

Unknown column 'CanDelete' in 'field list'
IN POST /admin/pages/edit/EditForm
Line 580 in /home/acthoust/public_html/framework/model/MySQLDatabase.php

Source
======
571:    }
572:
573:    public function databaseError($msg, $errorLevel = E_USER_ERROR) {
574:       // try to extract and format query
575:       if(preg_match('/Couldn\'t run query: ([^\|]*)\|\s*(.*)/', $msg, $matches)) {
576:          $formatter = new SQLFormatter();
577:          $msg = "Couldn't run query: \n" . $formatter->formatPlain($matches[1]) . "\n\n" . $matches[2];
578:       }
579:
* 580:       user_error($msg, $errorLevel);
581:    }
582:
583:    /**
584:     * Return a boolean type-formatted string
585:     *
586:     * @param array $values Contains a tokenised list of info about this data type

Trace
=====
user_error(Couldn't run query:
INSERT INTO "EditableFormField_versions" ("Required", "CustomRules", "CustomSettings", "Default", "CustomErrorMessage", "LastEdited", "ClassName", "Created", "Name", "Title", "Sort", "CanDelete", "CustomParameter", "ParentID", "Version", "RecordID", "AuthorID") VALUES ('1', 'a:0:{}', 'a:6:{s:10:\"ExtraClass\";s:0:\"\";s:10:\"RightTitle\";s:0:\"\";s:9:\"MinLength\";s:0:\"\";s:9:\"MaxLength\";s:0:\"\";s:4:\"Rows\";s:1:\"1\";s:10:\"ShowOnLoad\";s:4:\"Show\";}', null, null, '2013-02-16 15:12:26', 'EditableTextField', '2008-11-03 10:10:51', 'EditableTextField1', '*First Name:', '0', '1', null, '81', 1, 1, 2)

Unknown column 'CanDelete' in 'field list',256)
MySQLDatabase.php:580

MySQLDatabase->databaseError(Couldn't run query: INSERT INTO "EditableFormField_versions" ("Required", "CustomRules", "CustomSettings", "Default", "CustomErrorMessage", "LastEdited", "ClassName", "Created", "Name", "Title", "Sort", "CanDelete", "CustomParameter", "ParentID", "Version", "RecordID", "AuthorID") VALUES ('1', 'a:0:{}', 'a:6:{s:10:\"ExtraClass\";s:0:\"\";s:10:\"RightTitle\";s:0:\"\";s:9:\"MinLength\";s:0:\"\";s:9:\"MaxLength\";s:0:\"\";s:4:\"Rows\";s:1:\"1\";s:10:\"ShowOnLoad\";s:4:\"Show\";}', null, null, '2013-02-16 15:12:26', 'EditableTextField', '2008-11-03 10:10:51', 'EditableTextField1', '*First Name:', '0', '1', null, '81', 1, 1, 2) | Unknown column 'CanDelete' in 'field list',256)
MySQLDatabase.php:132

MySQLDatabase->query(INSERT INTO "EditableFormField_versions" ("Required", "CustomRules", "CustomSettings", "Default", "CustomErrorMessage", "LastEdited", "ClassName", "Created", "Name", "Title", "Sort", "CanDelete", "CustomParameter", "ParentID", "Version", "RecordID", "AuthorID") VALUES ('1', 'a:0:{}', 'a:6:{s:10:\"ExtraClass\";s:0:\"\";s:10:\"RightTitle\";s:0:\"\";s:9:\"MinLength\";s:0:\"\";s:9:\"MaxLength\";s:0:\"\";s:4:\"Rows\";s:1:\"1\";s:10:\"ShowOnLoad\";s:4:\"Show\";}', null, null, '2013-02-16 15:12:26', 'EditableTextField', '2008-11-03 10:10:51', 'EditableTextField1', '*First Name:', '0', '1', null, '81', 1, 1, 2))
Database.php:655

SS_Database->manipulate(Array)
DB.php:175

DB::manipulate(Array)
DataObject.php:1174

DataObject->write()
EditableFormField.php:380

EditableFormField->populateFromPostData(Array)
FieldEditor.php:157

FieldEditor->saveInto(UserDefinedForm)
Form.php:1229

Form->saveInto(UserDefinedForm)
CMSMain.php:825

CMSMain->save(Array,Form,SS_HTTPRequest)
Form.php:360

Form->httpSubmission(SS_HTTPRequest)
RequestHandler.php:184

RequestHandler->handleRequest(SS_HTTPRequest,DataModel)
RequestHandler.php:204

RequestHandler->handleRequest(SS_HTTPRequest,DataModel)
Controller.php:153

Controller->handleRequest(SS_HTTPRequest,DataModel)
LeftAndMain.php:357

LeftAndMain->handleRequest(SS_HTTPRequest,DataModel)
AdminRootController.php:89

AdminRootController->handleRequest(SS_HTTPRequest,DataModel)
Director.php:307

Director::handleRequest(SS_HTTPRequest,Session,DataModel)
Director.php:119

Director::direct(/admin/pages/edit/EditForm,DataModel)
main.php:126

Avatar
Willr

Forum Moderator, 5513 Posts

17 February 2013 at 10:19am

Ok, so looks like you upgraded userforms recently? You'll need to jump into your database and run a quick query.

http://www.silverstripe.org/all-other-modules/show/10228?start=8#post276161

Go to Top