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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

All other Modules /

Discuss all other Modules here.

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

struggling with Userforms in 2.3.4


Go to End


16 Posts   5665 Views

Avatar
anujkryadav

Community Member, 30 Posts

19 December 2009 at 6:36am

make sure tht you have named the userform folder in root directory as userforms,mine is working fine after i did tht

Avatar
anujkryadav

Community Member, 30 Posts

19 December 2009 at 6:37am

Sorry forget to tell you,you can change the foldr name and rebuild the CMS with dev/build,it will work fine

Avatar
zueri

Community Member, 8 Posts

23 December 2009 at 11:35pm

I'm also having problems with userforms after the update. I tried to update to the 0.2 branch as mentioned above. In my case, theres a javascript exception which savs:

$("#Form_Form").validate is not a function

I checked if the jquery.validate.min.js file ist there, and it is. Any idea how to solve the problem?

Avatar
BuddhaSource

Community Member, 57 Posts

27 December 2009 at 6:46pm

I just upgraded to new stable form on 2.3.4 build SS. Re published using task.

Now I am not able to publish or save my form type pages. Now the error I captured on FireBug is big .. but hope it gives you some in site.

Currently I have to make minor changes, doing it right from database :(

500//ERROR [User Error]: Couldn't run query: 
insert into `EditableFormField_versions` SET `Default` = null, `Required` = 1, `CanDelete` = 1, `CustomErrorMessage` = null, `CustomRules` = 'a:0:{}', `CustomSettings` = 'a:1:{s:10:\"ShowOnLoad\";s:4:\"Show\";}', `LastEdited` = now(), `ClassName` = 'EditableDropdown', `Created` = '2009-11-19 02:05:05', `Name` = 'EditableDropdown279', `Title` = 'Applying for', `Sort` = '1', `CustomParameter` = null, `ParentID` = '75', `Version` = 1, `RecordID` = 279 

Unknown column 'CustomParameter' in 'field list'
IN POST /admin/EditForm
Line 401 in /mnt/stor2-wc2-dfw1/426404/www.mywebsite.com/web/content/sapphire/core/model/MySQLDatabase.php

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

<ul>user_error(Couldn't run query: 
insert into `EditableFormField_versions` SET `Default` = null, `Required` = 1, `CanDelete` = 1, `CustomErrorMessage` = null, `CustomRules` = 'a:0:{}', `CustomSettings` = 'a:1:{s:10:\"ShowOnLoad\";s:4:\"Show\";}', `LastEdited` = now(), `ClassName` = 'EditableDropdown', `Created` = '2009-11-19 02:05:05', `Name` = 'EditableDropdown279', `Title` = 'Applying for', `Sort` = '1', `CustomParameter` = null, `ParentID` = '75', `Version` = 1, `RecordID` = 279 

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

MySQLDatabase->databaseError(Couldn't run query: insert into `EditableFormField_versions` SET `Default` = null, `Required` = 1, `CanDelete` = 1, `CustomErrorMessage` = null, `CustomRules` = 'a:0:{}', `CustomSettings` = 'a:1:{s:10:\"ShowOnLoad\";s:4:\"Show\";}', `LastEdited` = now(), `ClassName` = 'EditableDropdown', `Created` = '2009-11-19 02:05:05', `Name` = 'EditableDropdown279', `Title` = 'Applying for', `Sort` = '1', `CustomParameter` = null, `ParentID` = '75', `Version` = 1, `RecordID` = 279 | Unknown column 'CustomParameter' in 'field list',256)
line 102 of MySQLDatabase.php

MySQLDatabase->query(insert into `EditableFormField_versions` SET `Default` = null, `Required` = 1, `CanDelete` = 1, `CustomErrorMessage` = null, `CustomRules` = 'a:0:{}', `CustomSettings` = 'a:1:{s:10:\"ShowOnLoad\";s:4:\"Show\";}', `LastEdited` = now(), `ClassName` = 'EditableDropdown', `Created` = '2009-11-19 02:05:05', `Name` = 'EditableDropdown279', `Title` = 'Applying for', `Sort` = '1', `CustomParameter` = null, `ParentID` = '75', `Version` = 1, `RecordID` = 279)
line 418 of Database.php

Database->manipulate(Array)
line 133 of DB.php

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

DataObject->write()
line 292 of EditableFormField.php

EditableFormField->populateFromPostData(Array)
line 116 of EditableMultipleOptionField.php

EditableMultipleOptionField->populateFromPostData(Array)
line 146 of FieldEditor.php

FieldEditor->saveInto(UserDefinedForm)
line 886 of Form.php

Form->saveInto(UserDefinedForm,1)
line 649 of LeftAndMain.php

LeftAndMain->save(Array,Form,HTTPRequest)
line 241 of Form.php

Form->httpSubmission(HTTPRequest)
line 129 of RequestHandler.php

RequestHandler->handleRequest(HTTPRequest)
line 143 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/EditForm)
line 118 of main.php

</ul>
http://mywebsite.com/cms/javascript/LeftAndMain.js?m=1251788926
Line undefined

Avatar
BuddhaSource

Community Member, 57 Posts

31 December 2009 at 3:59am

Any possible solutions to this problem above ? I am really stuck right now.

More over I am having new problems.
When I run the publishing task it un-publishing some forms.

Avatar
Willr

Forum Moderator, 5523 Posts

1 January 2010 at 9:12pm

This is because an issue of old data not being removed - SS doesn't delete columns which aren't needed in the database (for data safely purposes) so occasionally you will get issues of columns existing (or not). The fix for this issue is to drop the customparameter field from the EditableFormField table. You can do this via a GUI like phpmyadmin or via mysql command line

ALTER TABLE `EditableFormField` DROP `CustomParameter`; 

Avatar
OzziNL

Community Member, 37 Posts

8 January 2010 at 1:04am

Edited: 08/01/2010 2:35am

Hi,
I faced the same problem and did the trick mentioned above.
Now I have the following problem when addind a field:

(SS: 2.3.4 and UserForms: 0.2.1)

ERROR [User Error]: Couldn't run query: 
insert into `EditableFormField_versions` SET `ClassName` = 'EditableTextField', `CanDelete` = 1, `LastEdited` = now(), `Created` = now(), `Name` = null, `Title` = null, `Default` = null, `Sort` = '0', `Required` = '0', `ParentID` = '0', `CustomErrorMessage` = null, `CustomRules` = null, `ShowOnLoad` = '0', `CustomSettings` = null, `Version` = 1, `RecordID` = 39 

Unknown column 'ShowOnLoad' in 'field list'
IN GET /admin/EditForm/field/Fields/addfield?NewID=1&Type=EditableTextField
Line 401 in /var/www/vhosts/kneib.com/httpdocs/sapphire/core/model/MySQLDatabase.php

--------- update:
Dropped all EditableFormField database entries and ran /dev/build ... now it is fine

Avatar
Fred Condo

Community Member, 29 Posts

19 January 2010 at 10:46am

To clarify Will's post, you have to drop the column that's mentioned in your error message. In our case, it was ShowOnLoad, hence: alter table EditableFormField drop ShowOnLoad;

Go to Top