Provide a trait to create image upload validators from settings

Created on 25 September 2023, about 1 year ago
Updated 26 September 2023, about 1 year ago

Problem/Motivation

In πŸ“Œ Provide a trait to create file upload validators from settings Needs review we discovered that ImageWidget and CKEditor5ImageController both duplicate the same logic for creating file upload validators from field settings.

Steps to reproduce

Proposed resolution

Create an ImageValidatorSettingsTrait to create file upload validators from field settings.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

πŸ“Œ Task
Status

Needs work

Version

11.0 πŸ”₯

Component
Image moduleΒ  β†’

Last updated 18 days ago

Created by

πŸ‡¦πŸ‡ΊAustralia kim.pepper πŸ„β€β™‚οΈπŸ‡¦πŸ‡ΊSydney, Australia

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @kim.pepper
  • πŸ‡¦πŸ‡ΊAustralia kim.pepper πŸ„β€β™‚οΈπŸ‡¦πŸ‡ΊSydney, Australia
  • Status changed to Needs work about 1 year ago
  • πŸ‡¦πŸ‡ΊAustralia kim.pepper πŸ„β€β™‚οΈπŸ‡¦πŸ‡ΊSydney, Australia

    Looks like CKEditor5ImageController gets it's image upload settings from \Drupal\editor\EditorInterface::getImageUploadSettings() which has a different array structure to field settings. 😞

    Not much chance of code re-use with a trait if that is the case.

  • last update about 1 year ago
    30,359 pass, 2 fail
  • @kimpepper opened merge request.
  • πŸ‡¦πŸ‡ΊAustralia kim.pepper πŸ„β€β™‚οΈπŸ‡¦πŸ‡ΊSydney, Australia

    Pushed up my code and test just in case this gets picked up in future.

Production build 0.71.5 2024