Problem/Motivation

Found config field fallback in tamper:strtotime with non-supported value.

Steps to reproduce

Create a ECA workflow that uses strtotime, once that the ECA workflow is triggered the database log will track the error above.

Proposed resolution

ModellerBpmnBase::prepareConfigFields() — when building BPMN plugin templates, it expects #type => 'checkbox' fields to have a PHP bool as their #default_value. NULL is not a bool and it generated the error log.

StrToTime::buildConfigurationForm() calls $this->getSetting('fallback') which returns NULL because defaultConfiguration() was never overridden to declare fallback => FALSE.

Fix: Add defaultConfiguration() to StrToTime.php returning ['date_format' => '', 'fallback' => FALSE].

Issue fork tamper-3582546

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

blanca.esqueda created an issue. See original summary.

blanca.esqueda’s picture

Status: Active » Needs review

mandclu made their first commit to this issue’s fork.

  • mandclu committed 3baf6ed9 on 8.x-1.x
    fix: #3582546 strtotime with non-supported fallback value
    
    By: blanca....
mandclu’s picture

Status: Needs review » Fixed
Related issues: +#3560959: Plugin strToTime is missing defaultConfiguration()

Technically, the cited issue was fixed in #3560959: Plugin strToTime is missing defaultConfiguration() months ago, but the version of this code is syntactically superior in some subtle ways, so updating the code. Thanks for contributing!

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.