[Vtigercrm-commits] [Vtiger development] #8280: Webforms fields are not saved.

Vtiger development vtiger-tickets at trac.vtiger.com
Wed Oct 1 17:22:42 GMT 2014


#8280: Webforms fields are not saved.
-----------------------+-----------------------
 Reporter:  jgarces    |      Owner:  developer
     Type:  defect     |     Status:  new
 Priority:  major      |  Milestone:  6.2.0
Component:  vtigercrm  |    Version:  6.1.0
 Severity:  High       |   Keywords:  Webforms
-----------------------+-----------------------
 In a clean instalation of vtiger 6.1.0, the webform module doesn't work
 correctly. This problem occurs also in previous version of vtiger (6.0.0).

 The symptoms are that if you want to save a webform with differents
 fields, the webform is saved but the fields not.

 The problem is due to vtiger_webforms_field table which is not created. If
 you search in the code (modules/Webforms/schema.xml) you can see the next
 sql sentence:

 CREATE TABLE `vtiger_webforms_field` (
   `id` int(19) NOT NULL AUTO_INCREMENT,
   `webformid` int(19) NOT NULL,
   `fieldname` varchar(50) NOT NULL,
   `neutralizedfield` varchar(50) NOT NULL,
   `defaultvalue` varchar(200) DEFAULT NULL,
   `required` int(10) NOT NULL DEFAULT '0',
   `sequence` int(10) DEFAULT NULL,
   `hidden` int(10) DEFAULT NULL,
   PRIMARY KEY (`id`),
   KEY `webforms_webforms_field_idx` (`id`),
   KEY `fk_1_vtiger_webforms_field` (`webformid`),
   KEY `fk_2_vtiger_webforms_field` (`fieldname`),
   CONSTRAINT `fk_1_vtiger_webforms_field` FOREIGN KEY (`webformid`)
 REFERENCES `vtiger_webforms` (`id`) ON DELETE CASCADE,
   CONSTRAINT `fk_3_vtiger_webforms_field` FOREIGN KEY (`fieldname`)
 REFERENCES `vtiger_field` (`fieldname`) ON DELETE CASCADE
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8

 That sql sentence has a mistake in the Constraint elements. The second
 constraint (fk_3_vtiger_webforms_field) launch a violation error in mysql
 due to the primary key of the vtiger_field table. The "fieldname" field is
 not the primary key.

 Then, if you want to this sql sentence works fine, you might create the
 table in this way:

 CREATE TABLE `vtiger_webforms_field` (
   `id` int(19) NOT NULL AUTO_INCREMENT,
   `webformid` int(19) NOT NULL,
   `fieldname` varchar(50) NOT NULL,
   `neutralizedfield` varchar(50) NOT NULL,
   `defaultvalue` varchar(200) DEFAULT NULL,
   `required` int(10) NOT NULL DEFAULT '0',
   `sequence` int(10) DEFAULT NULL,
   `hidden` int(10) DEFAULT NULL,
   PRIMARY KEY (`id`),
   KEY `webforms_webforms_field_idx` (`id`),
   KEY `fk_1_vtiger_webforms_field` (`webformid`),
   KEY `fk_2_vtiger_webforms_field` (`fieldname`),
   CONSTRAINT `fk_1_vtiger_webforms_field` FOREIGN KEY (`webformid`)
 REFERENCES `vtiger_webforms` (`id`) ON DELETE CASCADE,
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8

 With the creation of this table, the webform module works fine.

 Please, fix this issue in the following versions of vtiger.

 Thanks in advanced.

--
Ticket URL: <http://trac.vtiger.com/cgi-bin/trac.cgi/ticket/8280>
Vtiger development <http://trac.vtiger.com/>
Vtiger CRM


More information about the vtigercrm-commits mailing list