Drupal webform event8/6/2023 An error has occurred: Drupal\Core\Config\UnsupportedDataTypeConfigException: Invalid data type for config element _registration2006:open in /var/Drupal\Core\Config\StorableConfigBase->castValue('open', Object(Drupal\Core\Datetime\DrupalDateTime)) #1 /var/Drupal\Core\Config\Entity\ConfigEntityStorage->doSave('student_registr.', Object(Drupal\webform\Entity\Webform)) #3 /var/Drupal\Core\Config\Entity\ConfigEntityStorage->save(Object(Drupal\webform\Entity\Webform)) #5 /var/Drupal\Core\Entity\EntityBase->save() #7 /var/call_user_func_array('shgt_theme_help. $duplicate->set('close',$event_date_close) With $duplicate->set('open',$event_date_start) $event_date_close = new DrupalDateTime($reg_form_scheduled_close, 'EST') $event_date_start = new DrupalDateTime($reg_form_scheduled_open, 'EST') I tried re-casting as a date object, but that doesn't seem to be working either. If I try to set it as scheduled with the dates, then it throws Invalid data type for config element when saving the node. ![]() However, if I try to set it as Scheduled, it defaults to open. If it's set as "Closed", then it is created as closed. This module provides the paypalplus service which can be called anywhere on the system to implement the paypal payment. If it's set as "Open", then it sets correctly as open. Without setting the open/close dates, the form is created just fine. $duplicate->set('close',$reg_form_scheduled_close) $duplicate->set('open',$reg_form_scheduled_open) $duplicate->set('status',$reg_form_status) $duplicate = $webform->createDuplicate() $webform = \Drupal::entityTypeManager()->getStorage('webform')->load('student_registration') create a new instance of our pre-generated webform $reg_form_scheduled_close = $form_state->getValue('field_registration_form') $reg_form_scheduled_open = $form_state->getValue('field_registration_form') $reg_form_status = $form_state->getValue('field_registration_form') Get the status from the node creation form Here's a trimmed-down look at our code (I've omitted most of the superfluous stuff). On that node form, we want to give people the option to set the new form's status. We've got a node with a webform entity reference field that generates a new Webform. I hope this helps you as well, discovering it maybe a bit faster than it took me.I'm having a heck of a time setting the start date and end date for a Webform. Working seamlessly as the user would select something or erase the selection. All data layer values can be captured inside marketing. For example, every Drupal Webform submission or step-change includes the form ID, form placement
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |