3

I've generated a new report in my extension, but when I try to register it with CiviReport, I'm getting the following DB error: Database Error Code: Field of view 'sporti62_wp4.civicrm_option_value_en_CA' underlying table doesn't have a default value, 1423 Additional Details: Array ( [callback] => Array ( [0] => CRM_Core_Error [1] => handle )

[code] => -1
[message] => DB Error: unknown error
[mode] => 16
[debug_info] => INSERT INTO civicrm_option_value_en_CA (option_group_id , label , value , name , filter , is_default , weight , description , is_optgroup , is_active , component_id ) VALUES ( 41 , 'Dog Registry with Contacts' , 'dogregistry/contacts' , 'CRM_Dogregistry_Form_Report_Dog_Contact_Summary' ,  0 ,  0 ,  90 , 'Dog Registry with Contacts' ,  0 ,  1 ,  NULL )  [nativecode=1423 ** Field of view 'sporti62_wp4.civicrm_option_value_en_CA' underlying table doesn't have a default value]
[type] => DB_Error
[user_info] => INSERT INTO civicrm_option_value_en_CA (option_group_id , label , value , name , filter , is_default , weight , description , is_optgroup , is_active , component_id ) VALUES ( 41 , 'Dog Registry with Contacts' , 'dogregistry/contacts' , 'CRM_Dogregistry_Form_Report_Dog_Contact_Summary' ,  0 ,  0 ,  90 , 'Dog Registry with Contacts' ,  0 ,  1 ,  NULL )  [nativecode=1423 ** Field of view 'sporti62_wp4.civicrm_option_value_en_CA' underlying table doesn't have a default value]
[to_string] => [db_error: message="DB Error: unknown error" code=-1 mode=callback callback=CRM_Core_Error::handle prefix="" info="INSERT INTO civicrm_option_value_en_CA (option_group_id , label , value , name , filter , is_default , weight , description , is_optgroup , is_active , component_id ) VALUES ( 41 , 'Dog Registry with Contacts' , 'dogregistry/contacts' , 'CRM_Dogregistry_Form_Report_Dog_Contact_Summary' ,  0 ,  0 ,  90 , 'Dog Registry with Contacts' ,  0 ,  1 ,  NULL )  [nativecode=1423 ** Field of view 'sporti62_wp4.civicrm_option_value_en_CA' underlying table doesn't have a default value]"]

)

I know it is likely related wp_globus plugin? I do have two languages on my site - english and french.

2 Answers 2

2

Ok, again solved my own problem after doing more research. This apparently is a known issue with mySql and MariaDB where strict mode seems to be default. Adding sql_mode="" to your /etc/my.cnf file will resolve the issue.

1
  • Thanks for this! This helped us out this morning. Apr 7, 2020 at 16:07
1

For anyone happening upon this - the proposed solution is not correct. CiviCRM should function with STRICT mode enabled, which is enabled to ensure data integrity - turning it off is just ignoring the unlaying problem. If you come across an error like this one it should be reported so it can be fixed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.