Add "required" (allow null/empty) option to component parameters

Created on 28 July 2012, about 13 years ago
Updated 5 September 2025, 14 days ago

Currently component parameters must not take Null values, otherwise a component isn't called at all, so any property-setter component wouldn't work when a property is NULL.

Example: you create a component to calculate and set price for a commerce product so you pass commerce price property to that component. The problem comes when price is not set yet, since you can't pass NULL values to component.

The patch provided resolves this issue by adding "Required" column to the parameters table on the component settings form (see the screenshot NOTE: initially the option was logically inverted and was called "Allow Null". Now it is called "Required"). It is a checkbox with default value set to true (checked).

Feature request
Status

Needs work

Version

2.0

Component

Rules Core

Created by

🇹🇷Turkey OnkelTem İstanbul

Live updates comments and jobs are added and updated live.
  • Needs documentation

    A documentation change is requested elsewhere. For Drupal core (and possibly other projects), once the change has been committed, this status should be recorded in a change record node.

  • API change

    Changes an existing API or subsystem. Not backportable to earlier major versions, unless absolutely required to fix a critical bug.

  • API addition

    Enhances an existing API or introduces a new subsystem. Depending on the size and impact, possibly backportable to earlier major versions.

  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024