Empty Expiration Field Causes WSOD

Issue information

From user: bdunphy

Related to !506 (merged)

Contribution record

Fork management

Problem/Motivation

The Expiration field on the Expirable Key Value Store: Write action form is not required. Leaving this field empty will cause a PHP error:

TypeError: Unsupported operand types: int + string in Drupal\Core\KeyValueStore\DatabaseStorageExpirable->doSetWithExpire() (line 130 of /Users/betsyd/Sites/mysite/web/core/lib/Drupal/Core/KeyValueStore/DatabaseStorageExpirable.php).

This does leave a bit of a dilemma for my model. I'm looking to store expirable key / value pair data with a hard limit for how long this data should exist from the first write. I may be updating values within that timeframe but want the original expiration time.

At a minimum this field should be required (defined at line 55 of KeyValueExpirableStoreWrite.php).

Edited by drupalbot
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information