Convert media field_filesize to type integer

Created on 28 September 2021, about 3 years ago
Updated 1 March 2024, 9 months ago

Problem/Motivation

In anticipation of Remove hardcoded restriction of filesize formatter to fields named "filesize" Needs review we want field_filesize to be of the correct type, integer not the current string, so that once Remove hardcoded restriction of filesize formatter to fields named "filesize" Needs review is committed we can remove custom code from sector_wysiwyg_utils_preprocess_field() and use core and configuration to display human readable file size to the users.

Proposed resolution

Convert media field_filesize to type integer.

Remaining tasks

  • Agree on the approach
  • Convert the field configuration files field.field.media.file.field_filesize.yml & field.storage.media.field_filesize.yml
  • Write an update hook to convert field definition for existing installations preserving data
  • Remove custom file size formatting code from sector_wysiwyg_utils_preprocess_field()
  • Review patch
  • Manually test update path on existing installations
  • Commit

User interface changes

New field formatter available for the field_filesize , once Remove hardcoded restriction of filesize formatter to fields named "filesize" Needs review is resolved.

API changes

None

Data model changes

field_filesize storage type changed from varchar(255) to int .

Feature request
Status

Closed: outdated

Version

9.2

Component

Code

Created by

🇳🇿New Zealand RoSk0 Wellington

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

Production build 0.71.5 2024