Answers.Body: <p>It's probably because the language fields are set to NOT NULL in the database.</p>
  <p>Find out what the underlying table(s) are, and then with phpMyAdmin (or another database tool) you can set these fields to NULL.</p>
  <p>I remember I had to do this with the label_en_US, label_fr_FR... columns in the table civicrm_option_value.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-07-12T12:30:46.220Z
Answers.LastActivityDate: 2022-07-12T12:30:46.220Z
Answers.UserDisplayName: AlainB
Answers.Body: <p>I've had a similar issue and it turned out that when creating a new profile or profile field, it auto-generates a blank translation. That's okay the first time, but the second time it doesn't like it and generates an sql error.</p>
  <p>The only work-around solution I've found is to figure out the blank translation and put something in it (which your probably want to do anyway).</p>
  <p>If you've got sql access, then look at civicrm_uf_group and see if the non language/en_US fields are blank.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-07-05T18:01:24.680Z
Answers.LastActivityDate: 2022-07-05T18:01:24.680Z
Answers.UserDisplayName: Alan Dixon
Answers.Body: <p>Can you do <code>SELECT @@sql_mode</code>? My guess is it has STRICT_TRANS_TABLES in it, which makes multilingual very difficult to use on mariadb. If that's the problem, you can configure mysql to remove that from sql_mode. See also <a href="https://github.com/civicrm/civicrm-core/pull/22647#issuecomment-1025391599" rel="nofollow noreferrer">https://github.com/civicrm/civicrm-core/pull/22647#issuecomment-1025391599</a></p>
  <p>Either that or you have logging turned on at administer - system settings - misc, which isn't very compatible with multilingual.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-07-03T12:05:52.563Z
Answers.Text: Unfortunately "STRICT_TRANS_TABLES removal in sql_mode" didn't work ! The issue remain.
Answers.UserDisplayName: Tommy P
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-06-30T23:55:03.733Z
Answers.LastActivityDate: 2022-06-30T23:55:03.733Z
Answers.UserDisplayName: Demerit
Body: <p>Trying to create a new profile to get attached in contribution page, when hit save, a message box &quot;DB Error: unknown error&quot; appears.</p>
  <p>This happening on multilingual civiCRM setup on multiple versions 5.35.2 to 5.50.3. On single language CiviCRM setup this error doesn't appear instead.</p>
  <p>Looking in civiCRM log appears</p>
  <pre><code>    Jun 30 15:39:23  [debug] $Query = SELECT path, data, UNIX_TIMESTAMP(expired_date) as expires FROM civicrm_cache WHERE group_name = &quot;checks&quot; AND path = &quot;systemStatusCheckResult&quot;
  
  Jun 30 15:39:23  [info]  QUERY DONE IN 0.000821  seconds. Result is 0 rows by 3 columns. 
  
  Jun 30 15:39:23  [debug] $Query = BEGIN
  
  Jun 30 15:39:23  [debug] $Query = SELECT path, data, UNIX_TIMESTAMP(expired_date) as expires FROM civicrm_cache WHERE group_name = &quot;contact-20fields&quot; AND path = &quot;custom importableFields UFGroup_0_0_0_0__0__0__0_0__1_7acce319&quot;
  
  Jun 30 15:39:23  [info]  QUERY DONE IN 0.000765  seconds. Result is 0 rows by 3 columns. 
  
  Jun 30 15:39:23  [debug] $Query = INSERT INTO `civicrm_uf_group_en_US` (`is_active` , `title` , `frontend_title` , `help_pre` , `help_post` , `is_update_dupe` , `name` , `created_id` , `created_date` ) VALUES ( 1 , 'New Membership Signup' ,  NULL ,  NULL ,  NULL ,  1 , 'New_Membership_Signup' ,  2 ,  20220630153923 ) 
  
  Jun 30 15:39:23  [debug] $Query = COMMIT
  </code></pre>
  <p>When look in database this record does not exist.</p>
  <p>----- Update ----
  <a href="https://i.sstatic.net/1vQGo.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/1vQGo.png" alt="DB Error on profile creation" /></a></p>
  <p>CiviCRM ver: 5.35.2 to 5.50.3, Wordpress ver: 5.9.1, PHP ver: 7.3.31, MariaDB ver: 10.3.31</p>
  <p>Thanks for any guidance!</p>
  
Tags: <wordpress><profile><contribution-page><multilingual>
Title: DB Error : Uknown error (When a new profile is created in multilingual CiviCRM setup)
ThreadText: # DB Error : Uknown error (When a new profile is created in multilingual CiviCRM setup)
  
  (Asked by: username_0 on 2022-06-30)
  
  Trying to create a new profile to get attached in contribution page, when hit save, a message box "DB Error: unknown error" appears.
  This happening on multilingual civiCRM setup on multiple versions 5.35.2 to 5.50.3. On single language CiviCRM setup this error doesn't appear instead.
  Looking in civiCRM log appears
      Jun 30 15:39:23  [debug] $Query = SELECT path, data, UNIX_TIMESTAMP(expired_date) as expires FROM civicrm_cache WHERE group_name = "checks" AND path = "systemStatusCheckResult"
  
  Jun 30 15:39:23  [info]  QUERY DONE IN 0.000821  seconds. Result is 0 rows by 3 columns. 
  
  Jun 30 15:39:23  [debug] $Query = BEGIN
  
  Jun 30 15:39:23  [debug] $Query = SELECT path, data, UNIX_TIMESTAMP(expired_date) as expires FROM civicrm_cache WHERE group_name = "contact-20fields" AND path = "custom importableFields UFGroup_0_0_0_0__0__0__0_0__1_7acce319"
  
  Jun 30 15:39:23  [info]  QUERY DONE IN 0.000765  seconds. Result is 0 rows by 3 columns. 
  
  Jun 30 15:39:23  [debug] $Query = INSERT INTO `civicrm_uf_group_en_US` (`is_active` , `title` , `frontend_title` , `help_pre` , `help_post` , `is_update_dupe` , `name` , `created_id` , `created_date` ) VALUES ( 1 , 'New Membership Signup' ,  NULL ,  NULL ,  NULL ,  1 , 'New_Membership_Signup' ,  2 ,  20220630153923 ) 
  
  Jun 30 15:39:23  [debug] $Query = COMMIT
  
  When look in database this record does not exist.
  ----- Update ----
  
  CiviCRM ver: 5.35.2 to 5.50.3, Wordpress ver: 5.9.1, PHP ver: 7.3.31, MariaDB ver: 10.3.31
  Thanks for any guidance!
  
  **Tags:** wordpress, profile, contribution-page, multilingual
  
  
  ---
  
  ## 3 answers
  
  ### Answer by username_1 on 2022-07-12. Score: 0 | Accepted answer
  
  It's probably because the language fields are set to NOT NULL in the database.
  
  Find out what the underlying table(s) are, and then with phpMyAdmin (or another database tool) you can set these fields to NULL.
  
  I remember I had to do this with the label\_en\_US, label\_fr\_FR... columns in the table civicrm\_option\_value.
  
  
  ---
  
  ### Answer by username_2 on 2022-07-05. Score: 0
  
  I've had a similar issue and it turned out that when creating a new profile or profile field, it auto-generates a blank translation. That's okay the first time, but the second time it doesn't like it and generates an sql error.
  
  The only work-around solution I've found is to figure out the blank translation and put something in it (which your probably want to do anyway).
  
  If you've got sql access, then look at civicrm\_uf\_group and see if the non language/en\_US fields are blank.
  
  
  ---
  
  ### Answer by username_3 on 2022-06-30. Score: 0
  
  Can you do `SELECT @@sql_mode`? My guess is it has STRICT\_TRANS\_TABLES in it, which makes multilingual very difficult to use on mariadb. If that's the problem, you can configure mysql to remove that from sql\_mode. See also <https://github.com/civicrm/civicrm-core/pull/22647#issuecomment-1025391599>
  
  Either that or you have logging turned on at administer - system settings - misc, which isn't very compatible with multilingual.
  
  > **Comments:**
  > **username_0**: Unfortunately "STRICT_TRANS_TABLES removal in sql_mode" didn't work ! The issue remain.  
  
  ---
  
  