Problem/Motivation

It is very difficult to alter and enhance webform element properties.

Proposed resolution

Move all webform element properties to static definitions and allow them to be altered and cached while maintaining some backward compatibility

  • Makes it very easy for element properties to be removed from the UI
  • Makes it easier to add custom element properties to the UI
  • Makes it possible to change an element's default property

Notes

Remaining tasks

  • \Drupal\webform\Plugin\WebformElementManager add new methods
  • WebformElement - Convert class property methods to static methods
  • Add dedicated 'Property definition' section to WeformElement.
  • Able to use static method on WebformElement without the WebformElementManager

User interface changes

None

API changes

  • WebformElementBase::getDefaultProperties => WebformElementBase::propertyDefinitions
  • WebformElementBase::getTranslatedProperties => WebformElementBase::translatedProperties
  • Deprecated WebformElementBase::getDefaultMultipleProperties => ::properyMultipleDefinitions()
  • Deprecated WebformElementBase::getDefaultBaseProperties => ::properyBaseDefinitions()

Hooks

  • hook_webform_element_info_alter

Data model changes

The same data structure, using a different method.

Release notes snippet

  • Property help methods will be deprecated and moved to static methods.

Comments

jrockowitz created an issue. See original summary.

  • aa76219 committed on 3105878-element-properties
    Issue #3105878: Move all webform element properties to static...

  • 2eeea15 committed on 3105878-element-properties
    Issue #3105878: Move all webform element properties to static...

  • 80dcdea committed on 3105878-element-properties
    Issue #3105878: Move all webform element properties to static...
jrockowitz’s picture

StatusFileSize
new95.15 KB

To make sure there will be no regressions (i.e. lost or alter element properties) the attached YAML export of all the current element properties will be compared to this issue's final element properties.

  • c8608f5 committed on 3105878-element-properties
    Issue #3105878: Move all webform element properties to static...

  • 3e25b92 committed on 3105878-element-properties
    Issue #3105878: Move all webform element properties to static...

  • 625793f committed on 3105878-element-properties
    Issue #3105878: Move all webform element properties to static...

  • 29f0cee committed on 3105878-element-properties
    Issue #3105878: Move all webform element properties to static...

  • 836a361 committed on 3105878-element-properties
    Issue #3105878: Move all webform element properties to static...

  • 4b4ccb9 committed on 3105878-element-properties
    Issue #3105878: Move all webform element properties to static...

  • e975354 committed on 3105878-element-properties
    Issue #3105878: Move all webform element properties to static...

  • 1a78a28 committed on 3105878-element-properties
    Issue #3105878: Move all webform element properties to static...

  • 2b43f3d committed on 3105878-element-properties
    Issue #3105878: Move all webform element properties to static...
jrockowitz’s picture

Issue summary: View changes
jrockowitz’s picture

Issue summary: View changes

  • 8a4ea6e committed on 3105878-element-properties
    Issue #3105878: Move all webform element properties to static...

  • 0e33028 committed on 3105878-element-properties
    Issue #3105878: Move all webform element properties to static...

  • 461bded committed on 3105878-element-properties
    Issue #3105878: Move all webform element properties to static...
jrockowitz’s picture

Status: Active » Needs review
StatusFileSize
new232.5 KB

  • ef69029 committed on 3105878-element-properties
    Issue #3105878: Move all webform element properties to static...
jrockowitz’s picture

Status: Needs review » Postponed

So this patch has broken the Webform Composite Tools module. The issue is related to a recursion triggered by the composite's sub-element when the element definition is being built. Frankly, I think this patch has bitten off more than can be chewed in a single ticket/patch. The refactoring of webform element property handling should be broken down into smaller incremental changes.

jrockowitz’s picture

Status: Postponed » Closed (outdated)