After saving a scheduled email handler with a positive amount of days, and then edit it again, the number of days doesn't show the right value.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Nitebreed created an issue. See original summary.

Nitebreed’s picture

Patch attached

Lendude’s picture

#2 works but I would change the $days_options array to match the data that is stored for the handler. In #2 we add the + twice.

so do:

    foreach ($days as $day) {
      $days_options[$day] = $this->t('+ @day days', ['@day' => $day]);
    }

Or update the webform.handler.scheduled_email schema for the days key to store a string and not an integer (which is what is currently getting stored if you want to include the + in the value). But a schema change would break BC so we'd need an upgrade path for that, seems like a hassle.

Nitebreed’s picture

Yes you're right, since it is an integer we do't need the '+' in the key. Changing the schema to a string isn't a solution, since we also do calculations on this value.

  • jrockowitz committed 9edc45f on 8.x-5.x authored by Nitebreed
    Issue #2924247 by Nitebreed: Scheduled mail - Default value for number...
jrockowitz’s picture

Status: Needs review » Fixed

Thanks for catching that.

Status: Fixed » Closed (fixed)

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