Better empty file handling and allow specifying path instead of upload

Created on 3 March 2023, almost 2 years ago
Updated 31 May 2023, over 1 year ago

Problem/Motivation

When a new view is first created, or if the file uploaded somehow doesn't exist, a fatal error happens on this line within the Docx serializer:

      $file_path = \Drupal::service('file_system')->realpath($file->getFileUri());

Steps to reproduce

Create a word export view but don't upload the file, or remove the uploaded file and load the view.

Proposed resolution

Check for empty file and throw a relevant exception. Additionally, allow specifying a relative path to a file in the view config so template documents can be committed to code, etc.

User interface changes

Adds a file path text field to the view config.

✨ Feature request
Status

Fixed

Version

3.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States jhedstrom Portland, OR

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

Comments & Activities

Production build 0.71.5 2024