Generated image disappears from Layout Builder UI after 6 hours due to gap between temporary file age and tempstore expiration

Created on 22 March 2018, over 6 years ago
Updated 8 February 2024, 11 months ago

Problem/Motivation

The Layout Builder UI for a bundle's "Manage Display" creates a sample entity for arranging the fields.
This is stored in tempstore, which has an expiry of 7 days.

However, if the sample entity has a file or image field, the sample file is stored as a temporary file, which has an expiry of 6 hours.

After 6 hours but before 7 days have passed, any action in the Layout Builder UI will cause the following
Call to a member function getValue() on null in Drupal\file\Plugin\Validation\Constraint\FileValidationConstraintValidator->validate() (line 18 of /srv/bindings/9c9fb46000b0451caf842668d3816489/code/core/modules/file/src/Plugin/Validation/Constraint/FileValidationConstraintValidator.php)

Proposed resolution

TBD

Remaining tasks

Write tests
Figure out a solution

User interface changes

N/A

API changes

N/A

Data model changes

N/A

πŸ› Bug report
Status

Needs work

Version

11.0 πŸ”₯

Component
Layout builderΒ  β†’

Last updated 2 days ago

Created by

πŸ‡ΊπŸ‡ΈUnited States veronicaSeveryn

Live updates comments and jobs are added and updated live.
  • 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.

  • Blocks-Layouts

    Blocks and Layouts Initiative. See the #2811175 Add layouts to Drupal issue.

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.

  • πŸ‡³πŸ‡ΏNew Zealand danielveza Brisbane, AU

    I almost think this could be closed now that the other issue has been fixed. We no longer get a WSOD and the "Placeholder for the "Image" field" fallback text feels perfectly acceptable to me considering this is somewhat rare and had no updates for 5+ years?

Production build 0.71.5 2024