vt8.2 webforms field table is missing
After a new, local test installation of version 8.2, webforms does not work. No fields are saved in a webform and a white page appears after trying to edit an saved webform.
This problem was already known in older versions and has unfortunately not been fixed.
The table ‘vtiger_webforms_field’ is missing in the database during installation. This is not created during installation.
Activity
-
Newest first Oldest first
-
Show all activity Show comments only Show history only
- Daniel Lennartz changed the description
changed the description
- Contributor
This is the same in the current master too. Checking the installation log I see the why the table creation failed:
logs/vtigercrm.log:11160:[2024-09-24 14:57:04] - DEBUG - VT - SQL: CREATE TABLE `vtiger_webforms_field` ( logs/vtigercrm.log:11171: KEY `fk_1_vtiger_webforms_field` (`webformid`), logs/vtigercrm.log:11172: KEY `fk_2_vtiger_webforms_field` (`fieldname`), logs/vtigercrm.log:11173: CONSTRAINT `fk_1_vtiger_webforms_field` FOREIGN KEY (`webformid`) REFERENCES `vtiger_webforms` (`id`) ON DELETE CASCADE, logs/vtigercrm.log:11174: CONSTRAINT `fk_3_vtiger_webforms_field` FOREIGN KEY (`fieldname`) REFERENCES `vtiger_field` (`fieldname`) ON DELETE CASCADE logs/vtigercrm.log:11176:[2024-09-24 14:57:04] - DEBUG - VT - Prepared sql query being executed : CREATE TABLE `vtiger_webforms_field` ( logs/vtigercrm.log:11187: KEY `fk_1_vtiger_webforms_field` (`webformid`), logs/vtigercrm.log:11188: KEY `fk_2_vtiger_webforms_field` (`fieldname`), logs/vtigercrm.log:11189: CONSTRAINT `fk_1_vtiger_webforms_field` FOREIGN KEY (`webformid`) REFERENCES `vtiger_webforms` (`id`) ON DELETE CASCADE, logs/vtigercrm.log:11190: CONSTRAINT `fk_3_vtiger_webforms_field` FOREIGN KEY (`fieldname`) REFERENCES `vtiger_field` (`fieldname`) ON DELETE CASCADE logs/vtigercrm.log:11192:[2024-09-24 14:57:04] - INFO - VT - PearDatabase ->ADODB error Query Failed:CREATE TABLE `vtiger_webforms_field` ( logs/vtigercrm.log:11203: KEY `fk_1_vtiger_webforms_field` (`webformid`), logs/vtigercrm.log:11204: KEY `fk_2_vtiger_webforms_field` (`fieldname`), logs/vtigercrm.log:11205: CONSTRAINT `fk_1_vtiger_webforms_field` FOREIGN KEY (`webformid`) REFERENCES `vtiger_webforms` (`id`) ON DELETE CASCADE, logs/vtigercrm.log:11206: CONSTRAINT `fk_3_vtiger_webforms_field` FOREIGN KEY (`fieldname`) REFERENCES `vtiger_field` (`fieldname`) ON DELETE CASCADE logs/vtigercrm.log:11207:) ENGINE=InnoDB DEFAULT CHARSET=utf8::->[3780]Referencing column 'fieldname' and referenced column 'fieldname' in foreign key constraint 'fk_3_vtiger_webforms_field' are incompatible. 111
- Contributor
I believe that the issue is that on recent versions of MySQL the default charset and collation are set to (IMHO correctly) utf8mb4.
Until vtiger changes all the schemas to use utfmb4 when you create the database initially you should set it to utf8, e.g.
CREATE DATABASE `vtiger` DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
- Contributor
@prasad It might be a good idea to actually include a check that the database (if it was created manually by a user before starting the installation) is set to the correct charset and collation?
This was mine from yesterday:
The webform_field table was not created. I dropped the database and recreated setting the charset and collation to utf8 then re-installed vtiger. It worked fine when set correctly. But when not set correctly it fails silently - there may be other failures during install too - especially with foreign keys etc.
- ContributorEdited by Alan Lord
- Contributor
Here are where the failures occur during installation:
/var/www/html/vt830$ grep -n "ADODB error" logs/vtigercrm.log 11186:[2024-09-26 13:51:04] - INFO - VT - PearDatabase ->ADODB error Query Failed:CREATE TABLE `vtiger_webforms_field` ( 23498:[2024-09-26 13:51:30] - INFO - VT - PearDatabase ->ADODB error Query Failed:ALTER TABLE vtiger_webforms_field MODIFY COLUMN defaultvalue TEXT::->[1146]Table 'vt830.vtiger_webforms_field' doesn't exist 23613:[2024-09-26 13:51:31] - INFO - VT - PearDatabase ->ADODB error Query Failed:CREATE TABLE vtiger_cv2role(`cvid` int(25) NOT NULL, 23624:[2024-09-26 13:51:31] - INFO - VT - PearDatabase ->ADODB error Query Failed:CREATE TABLE vtiger_cv2rs(`cvid` int(25) NOT NULL, 24864:[2024-09-26 13:51:34] - INFO - VT - PearDatabase ->ADODB error Query Failed:CREATE TABLE vtiger_report_sharerole(`reportid` int(25) NOT NULL, 24875:[2024-09-26 13:51:34] - INFO - VT - PearDatabase ->ADODB error Query Failed:CREATE TABLE vtiger_report_sharers(`reportid` int(25) NOT NULL,