Add the base path to uppy_integration.js

Created on 24 January 2022, almost 3 years ago
Updated 20 March 2023, over 1 year ago

Problem/Motivation

If the Drupal is installed inside a subdirectory e.g.: cms and the base url is like http://localhost/cms the widget cannot work because the tus endpoint will be /cms/tus/upload and the upload complete path will be /cms/tus/upload-complete/.

Steps to reproduce

Create a new composer project, move the contents of the web directory into a cms subdirectory and update the composer.json to use web/cms as the web-root, try to use uppy widget.

Proposed resolution

The widget has to deal with base path.
Please add \Drupal::request()->getBasePath() to the settings array in UppyWidget::formElement() that is used by the uppy_integration.js, and prefix the tus endpoint path and the upload complete path with it. Or make the base path configurable.

πŸ“Œ Task
Status

Fixed

Version

2.0

Component

Code

Created by

πŸ‡­πŸ‡ΊHungary pauger

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