Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 295251

Provide a trait to get file upload location from field settings

$
0
0

Problem/Motivation

Part of #3221796: [META] Modernise file upload logic we identified that we are duplicating the code to find the file upload location in the following places:

  • \Drupal\file\Plugin\Field\FieldType\FileItem::getUploadLocation()
  • \Drupal\file\Plugin\rest\resource\FileUploadResource::getUploadLocation()
  • \Drupal\jsonapi\Controller\TemporaryJsonapiFileFieldUploader::getUploadLocation()

We can't really create a base class and use inheritance for this, as they use different methods of uploading files (ie. UploadedFile vs input stream).

Steps to reproduce

Proposed resolution

Create a trait that gets the upload destination from the field settings, and remove the duplication.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet


Viewing all articles
Browse latest Browse all 295251

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>