Problem/Motivation

There are several places in the module where possibly NULL values are passed to string functions, which will throw an error.

Steps to reproduce

This affects developers building functionality on top of the module that creates events programmatically, rather than events created through the UI.

For example, if an event series is created programmatically with daily recurrence and the end_time value is left NULL because the event is using duration instead—which would seem to be a legal thing to do, since end_time is not a required field—then passing this event to DailyRecurringDate::convertEntityConfigToArray will raise an error when it tries to call $config['end_time'] = strtoupper($event->getDailyEndTime());

Proposed resolution

Protect possibly NULL values with the null-coalescing operator when passing to string functions. For example, strtoupper($event->getDailyEndTime() ?? '');

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

muriqui created an issue. See original summary.

muriqui’s picture

Status: Active » Needs review
eric.napier’s picture

Status: Needs review » Reviewed & tested by the community

Tested in an integration environment with Recurring Events enabled, and executed PHPUnit tests to test scenarios that replicate the issue described in "Problem/Motivation" and "Steps to reproduce" in this ticket. All tests passed and code reviewed for standards / best practice.

  • muriqui committed d375c4af on 3.0.x
    fix: #3594934 Prevent NULL values from being passed to string functions...
muriqui’s picture

Status: Reviewed & tested by the community » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.