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 Forms 0.3.0 with SS 2.4.0 - Error Creating Field


Go to End
Reply


13 Posts   2723 Views

Avatar
pietro

Community Member, 18 Posts

12 June 2010 at 9:21am

I am using User Forms 0.3.0 with SS 2.4.0 and I get the "Error Creating Field" green box in the bottom left corner when I want to add a field.

There are some fixes for the older versions of User Forms but I couldn't find anything for 0.3.0.

My Firebug console shows this:

ERROR [User Error]: Uncaught SS_HTTPResponse_Exception: I can't handle sub-URLs of a Form object.
IN GET /admin/EditForm/field/Fields/addfield?NewID=1&Type=EditableTextField
Line 305 in /hermes/web02/b4/moo.mysite/sapphire/core/control/RequestHandler.php

Source
======
296:    /**
297:     * Throws a HTTP error response encased in a {@link SS_HTTPResponse_Exception}, which is later
caught in
298:     * {@link RequestHandler::handleAction()} and returned to the user.
299:     *
300:     * @param int $errorCode
301:     * @param string $errorMessage
302:     * @uses SS_HTTPResponse_Exception
303:     */
304:    public function httpError($errorCode, $errorMessage = null) {
* 305:       throw new SS_HTTPResponse_Exception($errorMessage, $errorCode);
306:    }
307:    
308:    /**
309:     * Returns the SS_HTTPRequest object that this controller is using.
310:     *
311:     * @return SS_HTTPRequest

Trace
=====
<ul>RequestHandler->httpError(404,I can't handle sub-URLs of a Form object.)
line 165 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/field/Fields/addfield)
line 127 of main.php

</ul>

Thank you,

Avatar
Willr

Forum Moderator, 5513 Posts

12 June 2010 at 11:14am

Hm Haven't seen this specific error with it before. A couple things to try

* Rebuild the database
* Turn off JS combining by adding Requirements::set_combined_files_enabled(false);
* Reload the CMS with a ?flush=1.

Avatar
pietro

Community Member, 18 Posts

13 June 2010 at 4:38am

thanks will,

so i reinstalled the userforms folder, deleted all editable and userforms tables. I ran dev/build and flushed the cms.

i also added the line of code at the bottom my config file but unfortunately i am still getting the same error.

firebug this time is (very similar):

ERROR [User Error]: Uncaught SS_HTTPResponse_Exception: I can't handle sub-URLs of a Form object.
IN GET /admin/EditForm/field/Fields/addfield?NewID=1&Type=EditableFormHeading
Line 305 in /hermes/web02/b4/moo.talksolarorg/sapphire/core/control/RequestHandler.php

Source
======
296:    /**
297:     * Throws a HTTP error response encased in a {@link SS_HTTPResponse_Exception}, which is later
caught in
298:     * {@link RequestHandler::handleAction()} and returned to the user.
299:     *
300:     * @param int $errorCode
301:     * @param string $errorMessage
302:     * @uses SS_HTTPResponse_Exception
303:     */
304:    public function httpError($errorCode, $errorMessage = null) {
* 305:       throw new SS_HTTPResponse_Exception($errorMessage, $errorCode);
306:    }
307:    
308:    /**
309:     * Returns the SS_HTTPRequest object that this controller is using.
310:     *
311:     * @return SS_HTTPRequest

Trace
=====
<ul>RequestHandler->httpError(404,I can't handle sub-URLs of a Form object.)
line 165 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/field/Fields/addfield)
line 127 of main.php

</ul>

i want to continue trying but i need guidance, not sure what to try next.

thanks, p.

Avatar
Willr

Forum Moderator, 5513 Posts

13 June 2010 at 11:47am

And the other common issue to check is the folder is named 'userforms' and not 'userforms-r10012'. I don't think that would be the cause (since normally you would get a white screen but check :) )

Hm perhaps try a completely new install (SS 2.4, UDF 0.3 and new database) and see what happens. What is your environment? (php version, server os, etc) I will try and reproduce.

Avatar
pietro

Community Member, 18 Posts

14 June 2010 at 4:50am

hi will,

my server settings are:

Platform: Debian
MySQL: 5.0.77
Perl: 5.8.8
PHP: 5.2.12

is this enough to simulate?

thanks!

Avatar
Willr

Forum Moderator, 5513 Posts

14 June 2010 at 12:37pm

Thanks Pietro.

I have made a ticket to look into it http://open.silverstripe.org/ticket/5709. I won't have time to setup a test machine for it this week but I will check with that environment.

Avatar
pietro

Community Member, 18 Posts

14 June 2010 at 3:07pm

Thank you Will, I will keep looking into it as well.

I let you know if I find anything,

P.

Avatar
scpi

Community Member, 21 Posts

18 June 2010 at 8:56am

I'm getting the "Error Creating Field" now too, but the underlying error is different from what you've posted.

In the console, I'm getting this:

Failed to load resource: the server responded with a status of 500 (Error: "Couldn't run query: INSERT INTO "EditableFormField_versions" ("ClassName", "CanDelete", "LastEdited", "Created", "Name", "Title", "Default", "Sort", "Required", "CustomErrorMessage", "CustomRules", "CustomSettings", "ParentID", "ShowOnLoad", "Version", "CustomParameter", "RecordID", "AuthorID") VALUES ('EditableDropdown', '1', '2010-06-17 15:02:25', '2010-06-17 15:02:25', null, null, null, '0', '0', null, null, null, '0', '0', 1, null, 42, 1) Unknown column 'ShowOnLoad' in 'field list'" at line 536 of /Applications/MAMP/htdocs/sapphire/core/model/MySQLDatabase.php)

ShowOnLoad looks like it comes from EditableFormField on line 28

   static $defaults = array(
      "CanDelete" => "1",
      "ShowOnLoad" => "1"
   );

My EditableFormField table has a ShowOnLoad column, but EditableFormField_versions and EditableFormField_Live do not.
I've rebuilt the database, but it hasn't helped.

Manually adding the column ShowOnLoad to the EditableFormField_versions table seems to have fixed the problem. This seems like a less-than-optimal situation.

Another oddity I've noticed is that the wiki says there might be problems if you have a 'CustomParameter' column in your EditableFormField tables, but I don't see how it could work without it. ( see http://doc.silverstripe.org/upgrading:2.4.0#user-defined_forms )

Here's the entire error message:

ERROR [User Error]: Couldn't run query:
INSERT INTO "EditableFormField_versions" ("ClassName", "CanDelete", "LastEdited", "Created", "Name", "Title", "Default", "Sort", "Required", "CustomErrorMessage", "CustomRules", "CustomSettings", "ParentID", "ShowOnLoad", "Version", "CustomParameter", "RecordID", "AuthorID") VALUES ('EditableDropdown', '1', '2010-06-17 15:02:25', '2010-06-17 15:02:25', null, null, null, '0', '0', null, null, null, '0', '0', 1, null, 42, 1)

Unknown column 'ShowOnLoad' in 'field list'
IN GET /admin/EditForm/field/Fields/addfield?NewID=1&Type=EditableDropdown
Line 536 in /Applications/MAMP/htdocs/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", "CanDelete", "LastEdited", "Created", "Name", "Title", "Default", "Sort", "Required", "CustomErrorMessage", "CustomRules", "CustomSettings", "ParentID", "ShowOnLoad", "Version", "CustomParameter", "RecordID", "AuthorID") VALUES ('EditableDropdown', '1', '2010-06-17 15:02:25', '2010-06-17 15:02:25', null, null, null, '0', '0', null, null, null, '0', '0', 1, null, 42, 1)

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

MySQLDatabase->databaseError(Couldn't run query: INSERT INTO "EditableFormField_versions" ("ClassName", "CanDelete", "LastEdited", "Created", "Name", "Title", "Default", "Sort", "Required", "CustomErrorMessage", "CustomRules", "CustomSettings", "ParentID", "ShowOnLoad", "Version", "CustomParameter", "RecordID", "AuthorID") VALUES ('EditableDropdown', '1', '2010-06-17 15:02:25', '2010-06-17 15:02:25', null, null, null, '0', '0', null, null, null, '0', '0', 1, null, 42, 1) | Unknown column 'ShowOnLoad' in 'field list',256)
line 134 of MySQLDatabase.php

MySQLDatabase->query(INSERT INTO "EditableFormField_versions" ("ClassName", "CanDelete", "LastEdited", "Created", "Name", "Title", "Default", "Sort", "Required", "CustomErrorMessage", "CustomRules", "CustomSettings", "ParentID", "ShowOnLoad", "Version", "CustomParameter", "RecordID", "AuthorID") VALUES ('EditableDropdown', '1', '2010-06-17 15:02:25', '2010-06-17 15:02:25', null, null, null, '0', '0', null, null, null, '0', '0', 1, null, 42, 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 192 of FieldEditor.php

FieldEditor->addfield(SS_HTTPRequest)
line 134 of RequestHandler.php

RequestHandler->handleRequest(SS_HTTPRequest)
line 152 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/field/Fields/addfield)
line 127 of main.php

Go to Top