Problem/Motivation
When resolve a activity of type: Dragn and Drop and and click next I have the following error
Steps to reproduce
The website encountered an unexpected error. Please try again later.
Drupal\Core\Entity\EntityStorageException: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'field_correct_response_value' at row 1: INSERT INTO {opigno_answer__field_correct_response} (entity_id, revision_id, bundle, delta, langcode, field_correct_response_value) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5); Array ( [:db_insert_placeholder_0] => 1 [:db_insert_placeholder_1] => 1 [:db_insert_placeholder_2] => opigno_h5p [:db_insert_placeholder_3] => 0 [:db_insert_placeholder_4] => en [:db_insert_placeholder_5] => 0[.]0[,]0[.]4[,]0[.]8[,]0[.]10[,]1[.]4[,]1[.]8[,]1[.]10[,]1[.]0[,]2[.]8[,]2[.]10[,]2[.]0[,]2[.]4[,]3[.]10[,]3[.]8[,]3[.]0[,]3[.]4[,]4[.]1[,]4[.]5[,]5[.]5[,]5[.]1[,]6[.]2[,]7[.]6[,]8[.]3[,]8[.]7[,]8[.]9[,]9[.]7[,]9[.]3[,]9[.]9[,]10[.]9[,]11[.]11[,]11[.]3[,]11[.]7 ) in Drupal\Core\Entity\Sql\SqlContentEntityStorage->save() (line 846 of core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php).
Drupal\Core\Database\Statement->execute(Array, Array) (Line: 640)
Drupal\Core\Database\Connection->query('INSERT INTO {opigno_answer__field_correct_response} (entity_id, revision_id, bundle, delta, langcode, field_correct_response_value) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5)', Array, Array) (Line: 357)
Drupal\Core\Database\Driver\mysql\Connection->query('INSERT INTO {opigno_answer__field_correct_response} (entity_id, revision_id, bundle, delta, langcode, field_correct_response_value) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5)', Array, Array) (Line: 32)
Drupal\Core\Database\Driver\mysql\Insert->execute() (Line: 1414)
Drupal\Core\Entity\Sql\SqlContentEntityStorage->saveToDedicatedTables(Object, 1, Array) (Line: 996)
Drupal\Core\Entity\Sql\SqlContentEntityStorage->doSaveFieldItems(Object) (Line: 665)
Drupal\Core\Entity\ContentEntityStorageBase->doSave('1', Object) (Line: 457)
Drupal\Core\Entity\EntityStorageBase->save(Object) (Line: 837)
Drupal\Core\Entity\Sql\SqlContentEntityStorage->save(Object) (Line: 395)
Drupal\Core\Entity\EntityBase->save() (Line: 52)
_opigno_h5_form_submit(Array, Object)
call_user_func_array('_opigno_h5_form_submit', Array) (Line: 114)
Drupal\Core\Form\FormSubmitter->executeSubmitHandlers(Array, Object) (Line: 52)
Drupal\Core\Form\FormSubmitter->doSubmitForm(Array, Object) (Line: 593)
Drupal\Core\Form\FormBuilder->processForm('opigno_answer_opigno_h5p_form', Array, Object) (Line: 321)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 61)
Drupal\Core\Entity\EntityFormBuilder->getForm(Object) (Line: 644)
Drupal\opigno_module\Controller\OpignoModuleController->moduleQuestionAnswerForm(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 573)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 151)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 68)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 52)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 708)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
Proposed resolution
I think it's because 'max_length' characters, I've applied this patch
https://www.drupal.org/files/issues/2020-04-15/3035615-9.patch →
but my problem is in a response and not in question.
I've attached the problem and h5p example