Answers.Body: <p>Did you create a large text field or a memo field? And if so did you inspect the logs? </p>
  
  <p>If it is a text field. I assume that mysql has a limit on the column size so probably it is failing because of that error. </p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-06-04T12:27:55.980Z
Answers.Text: Text field, yes. Our tests would suggest the same: too big of a field is a problem. But as far as I can find, MySQL can handle text fields much larger than 6000, e.g. here https://stackoverflow.com/questions/6766781/maximum-length-for-mysql-type-text says 65,535.
  
  In any case, my suggestion and hope posting this would be CiviCRM to add a popup warning if you try to create a text field too large, rather than leaving us guessing why it didn't work even though it still shows up on the field list as if it did.
Answers.UserDisplayName: user6119
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-06-05T07:52:42.070Z
Answers.Text: I am not sure whether a popup with a warning will show up. However I do agree that would be helpful.
Answers.UserDisplayName: Jaap Jansma - CiviCooP
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-06-01T09:45:27.837Z
Answers.LastActivityDate: 2018-06-01T09:45:27.837Z
Answers.UserDisplayName: Jaap Jansma - CiviCooP
Body: <p>We've discovered what seems to be a bug creating large text fields from CiviCRM Custom Fields. I hope I'm able to explain this well enough.</p>
  
  <p>Relevant environment information:
  - Drupal 7.59
  - CiviCRM 5.1.0 and then 5.1.2
  - PHP 5.5.9 (not recommended but supported)
  - Webform and Webform CiviCRM modules for Drupal enabled</p>
  
  <p>And the steps we took:
  1. Create custom fields of type text associated with a contact. Give it a very large database size, something like 6000. I haven't confirmed exactly at what point is too large, but 6000 definitely was.</p>
  
  <ol start="2">
  <li><p>Create a webform on the Drupal side with CiviCRM processing enabled. Make contact 1 for CiviCRM processing able to show the large field and also accepting existing contacts. Edit the webform field for the existing contact so it is a dropdown select (just for easier testing).</p></li>
  <li><p>Fill out the form once to create a contact, filling in that field.</p></li>
  <li><p>Go back to the form and select the existing contact to be the one you created. The field does not auto-populate.</p></li>
  <li><p>Alternate way to test this is to go to the form with the parameter ?cid=[id] added to the URL, which will show errors on the screen about the field not existing.</p></li>
  </ol>
  
  <p>====
  After investigation, we discovered that the root of the problem seemed to be that the field was not being created in the database table for the custom value. For example, if the custom field group was called constituent and it was the 3rd custom group, the table I believe would be civicrm_value_constituent_3. Each custom field of that field group normally gets a column in this table, but if the large text size is too big, it doesn't create the column and it doesn't give any warnings either. Manually creating the columns into the table fixed the problem, reinforcing that conclusion.</p>
  
  <p>It does still add to the civicrm_custom_field table, so no problem there. It's just the values table.</p>
  
Tags: <drupal><custom-fields><webform-civicrm>
Title: Large Text Fields Not Writing in Database
ThreadText: # Large Text Fields Not Writing in Database
  
  (Asked by: username_0 on 2018-05-31)
  
  We've discovered what seems to be a bug creating large text fields from CiviCRM Custom Fields. I hope I'm able to explain this well enough.
  
  Relevant environment information:
  - Drupal 7.59
  - CiviCRM 5.1.0 and then 5.1.2
  - PHP 5.5.9 (not recommended but supported)
  - Webform and Webform CiviCRM modules for Drupal enabled
  
  And the steps we took:
  1. Create custom fields of type text associated with a contact. Give it a very large database size, something like 6000. I haven't confirmed exactly at what point is too large, but 6000 definitely was.
  
  2. Create a webform on the Drupal side with CiviCRM processing enabled. Make contact 1 for CiviCRM processing able to show the large field and also accepting existing contacts. Edit the webform field for the existing contact so it is a dropdown select (just for easier testing).
  3. Fill out the form once to create a contact, filling in that field.
  4. Go back to the form and select the existing contact to be the one you created. The field does not auto-populate.
  5. Alternate way to test this is to go to the form with the parameter ?cid=[id] added to the URL, which will show errors on the screen about the field not existing.
  
  ====
  After investigation, we discovered that the root of the problem seemed to be that the field was not being created in the database table for the custom value. For example, if the custom field group was called constituent and it was the 3rd custom group, the table I believe would be civicrm\_value\_constituent\_3. Each custom field of that field group normally gets a column in this table, but if the large text size is too big, it doesn't create the column and it doesn't give any warnings either. Manually creating the columns into the table fixed the problem, reinforcing that conclusion.
  
  It does still add to the civicrm\_custom\_field table, so no problem there. It's just the values table.
  
  **Tags:** drupal, custom-fields, webform-civicrm
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2018-06-01. Score: 2
  
  Did you create a large text field or a memo field? And if so did you inspect the logs?
  
  If it is a text field. I assume that mysql has a limit on the column size so probably it is failing because of that error.
  
  > **Comments:**
  > **username_0**: Text field, yes. Our tests would suggest the same: too big of a field is a problem. But as far as I can find, MySQL can handle text fields much larger than 6000, e.g. here https://stackoverflow.com/questions/6766781/maximum-length-for-mysql-type-text says 65,535.  In any case, my suggestion and hope posting this would be CiviCRM to add a popup warning if you try to create a text field too large, rather than leaving us guessing why it didn't work even though it still shows up on the field list as if it did.  
  > **username_1**: I am not sure whether a popup with a warning will show up. However I do agree that would be helpful.  
  
  ---
  
  