Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jenlampton opened this issue Dec 27, 2024 · 3 comments
Open

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

jenlampton opened this issue Dec 27, 2024 · 3 comments
Assignees

Comments

@jenlampton
Copy link
Member

jenlampton commented Dec 27, 2024

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

@herbdool
Copy link

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?

@jenlampton
Copy link
Member Author

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
Copy link
Member Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants