Use $item object in Elements

Created on 4 January 2024, about 1 year ago
Updated 22 January 2024, 12 months ago

Problem/Motivation

In the attempt to move code into Object oriented fashion, it is discovered that processing the elements from the Office Hours Form, can use the $item object, instead of the $item->GetValue() values array.

This way, less code is needed, using subclassing.

Steps to reproduce

edit a form, save a form.

API changes

The Widget must set

@@ -155,7 +155,7 @@ class OfficeHoursTYPEWidget extends OfficeHoursWidgetBase {
         $elements[] = [
-          '#default_value' => $default_value,
+          '#default_value' => $item,
           '#day_index' => $day_index,
           '#day_delta' => $day_delta,
           // Add field settings, for usage in each Element.
📌 Task
Status

Fixed

Version

1.12

Component

Code - widget

Created by

🇳🇱Netherlands johnv

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

Comments & Activities

Production build 0.71.5 2024