Webform element preview serialize() error

Created on 27 September 2023, about 1 year ago
Updated 3 November 2023, about 1 year ago

Problem/Motivation

When using office hours and webform, when you try and add an element and then click on the preview button and then hide button, there is an error that prevents the preview from working anymore.

Steps to reproduce

Use webform and add a webform. Click on Add element, then click on preview element, then hide preview, the following error is thrown:

An AJAX HTTP error occurred.\nHTTP Result Code: 200\nDebugging information follows.\nPath: /admin/structure/webform/manage/test_form/element/add?_wrapper_format=drupal_modal&ajax_form=1\nStatusText: OK\nResponseText: TypeError: Argument 1 passed to Drupal\\office_hours\\Plugin\\WebformElement\\WebformOfficeHours::serialize() must be of the type array, string given, called in /var/www/html/web/profiles/uw_base_profile/modules/contrib/office_hours/src/Plugin/WebformElement/WebformOfficeHours.php on line 175 in Drupal\\office_hours\\Plugin\\WebformElement\\WebformOfficeHours::serialize() (line 343 of /var/www/html/web/profiles/uw_base_profile/modules/contrib/office_hours/src/Plugin/WebformElement/WebformOfficeHours.php).",
  "name": "AjaxError"

Proposed resolution

Will provide a patch to at least not show the error but no preview is shown of the element.

Remaining tasks

Try to get the preview to work,

🐛 Bug report
Status

Closed: works as designed

Version

1.11

Component

Code

Created by

🇨🇦Canada ebremner

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024