Details
-
Type: Bug
-
Status: Done/Fixed
-
Priority: Major
-
Resolution: Won't Fix
-
Affects Version/s: 2.2.0
-
Fix Version/s: 4.3.0
-
Component/s: Core CiviCRM
-
Labels:None
Description
When you have a long name for the group eg "extra info for the political parties" and you try to add a long field name (eg: "manifesto for the next campain", it tries to generate a table with a name too long:
FK_civicrm_value_political_party_extra_info_1_manifesto_brochure_10
Sorry. A non-recoverable error has occurred.
DB Error: a515ac9c2796ca0e23adbe92c68fc9fc
Database Error Code: Identifier name 'FK_civicrm_value_political_party_extra_info_1_manifesto_brochure_10' is too long, 1059
[code] => a515ac9c2796ca0e23adbe92c68fc9fc
[message] => DB Error: a515ac9c2796ca0e23adbe92c68fc9fc
[mode] => 16
[debug_info] => ALTER TABLE civicrm_value_political_party_extra_info_1
ADD COLUMN `manifesto_brochure_10` int unsigned,
ADD CONSTRAINT FK_civicrm_value_political_party_extra_info_1_manifesto_brochure_10 FOREIGN KEY ( `manifesto_brochure_10` ) REFERENCES civicrm_file ( id ) ON DELETE SET NULL [nativecode=1059 ** Identifier name 'FK_civicrm_value_political_party_extra_info_1_manifesto_brochure_10' is too long]
[type] => DB_Error
[user_info] => ALTER TABLE civicrm_value_political_party_extra_info_1
ADD COLUMN `manifesto_brochure_10` int unsigned,
ADD CONSTRAINT FK_civicrm_value_political_party_extra_info_1_manifesto_brochure_10 FOREIGN KEY ( `manifesto_brochure_10` ) REFERENCES civicrm_file ( id ) ON DELETE SET NULL [nativecode=1059 ** Identifier name 'FK_civicrm_value_political_party_extra_info_1_manifesto_brochure_10' is too long]
[to_string] => [db_error: message="DB Error: a515ac9c2796ca0e23adbe92c68fc9fc" code=0 mode=callback callback=CRM_Core_Error::handle prefix="" info=" ALTER TABLE civicrm_value_political_party_extra_info_1
ADD COLUMN `manifesto_brochure_10` int unsigned,
ADD CONSTRAINT FK_civicrm_value_political_party_extra_info_1_manifesto_brochure_10 FOREIGN KEY ( `manifesto_brochure_10` ) REFERENCES civicrm_file ( id ) ON DELETE SET NULL [nativecode=1059 ** Identifier name 'FK_civicrm_value_political_party_extra_info_1_manifesto_brochure_10' is too long]"]
)
Rem: you can't delete the field not edit it properly, the best option is to disable it