backdrop-issues icon indicating copy to clipboard operation
backdrop-issues copied to clipboard

I'm unable to upload a file through the managed file UI.

Open jenlampton opened this issue 11 months ago • 5 comments

Description of the bug

Uploading any file from the "Mange files" listing prevents the error The file could not be uploaded. Before the "Next" button is pressed (looks like it uploads automatically after being selected).

In the logs, I see this error:

The upload directory public:// for the file field (unknown) could not be created or is not accessible. A newly uploaded file could not be saved in this directory as a consequence, and the upload was canceled.

and also:

Warning: Undefined array key "#field_name" in file_managed_file_save_upload() (line 1661 of /var/www/html/docroot/core/modules/file/file.module).

The first message appears when

if (isset($destination) && !file_prepare_directory($destination, FILE_CREATE_DIRECTORY)) {

Maybe there is another reason file_prepare_directory() could fail?

Update: The second message I got yesterday, but not today. Today I have only the one about public://.

Things that are working as expected;

  • Replacing an existing file using the "manage" interface works as expected.
  • uploading a file into an image field on a node
  • Uploading a file via the "manage" interface works as expected in Drupal 7, but the field has an "upload" button you need to press to upload the file, it does not upload automatically.

Things i have checked;

  • the Public file system path is correct, as is the Temporary directory , hence them working for other things.
  • there are no field settings for the file field on the file entities.

Steps To Reproduce

To reproduce the behavior: 0. Upgrade from Drupal 7 + file entity module

  1. Go to 'admin/content/files'
  2. Click on '+ Add file'
  3. attempt to upload a file

The error appears on upload, before hitting "next"

Actual behavior

Error message The file could not be uploaded.

Expected behavior

victory!

Additional information

Add any other information that could help, such as: Debug info!

Backdrop CMS: 1.28.2 Installation profile: standard PHP version: 8.2.24 Drupal 7 compatibility: on Database server: 10.11.9-MariaDB-ubu2204-log Web server: nginx/1.26.2

jenlampton avatar Dec 27 '24 22:12 jenlampton

I'm testing this on 1.30.x-dev and I'm unable to recreate the bug. Can you provide a sample file or file type to help recreate it @jenlampton?

herbdool avatar Dec 28 '24 19:12 herbdool

It's the same for me with all files, but I'm still trying to figure out what happened in the upgrade that caused this -- Assigned to me until I can get that into the STR.

jenlampton avatar Dec 29 '24 22:12 jenlampton

I was able to reproduce this today - but will work on better STR once I figure out what's happening.

jenlampton avatar Dec 31 '24 22:12 jenlampton

I'm changing this to a question until we have some way of reproducing it. Step 1 of "upgrade from Drupal 7 with file entity" could be a pretty big hurdle, and it's not clear if that's the only variable at play here.

quicksketch avatar Jan 16 '25 05:01 quicksketch

I am still working on the site with this problem - I'll get back to it soon, I hope! (as we still can't add any files)

jenlampton avatar Jan 16 '25 06:01 jenlampton