Make error message of "The specified file '%original_source' could not be copied" more verbose.

Created on 12 December 2019, almost 5 years ago
Updated 10 February 2023, almost 2 years ago

Problem/Motivation

The original error message only includes $original_source.

As a copy operation always gets involved in a source and a destination. No destination info, which makes debugging copy operation harder.

Proposed resolution

Add the existed destination variables $destination and $dirname to the error message.

For example:

Before: The specified file 'public://test.txt' could not be copied because the destination directory is not properly configured. This may be caused by a problem with file or directory permissions.
After: The specified file 'public://test.txt' could not be copied to 'public://subdirectory/test.txt'. Because the destination directory 'public://subdirectory' is not properly configured. This may be caused by a problem with file or directory permissions.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

πŸ“Œ Task
Status

Needs work

Version

10.1 ✨

Component
File systemΒ  β†’

Last updated about 12 hours ago

Created by

πŸ‡¨πŸ‡³China jungle Chongqing, China

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.

  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    This issue is being reviewed by the kind folks in Slack, #needs-review-queue-initiative. We are working to keep the size of Needs Review queue [2700+ issues] to around 400 (1 month or less), following Review a patch or merge request β†’ as a guide.

    Did not see a test patch so ran locally without the fix and got

    Failed asserting that exception message 'The specified file 'public://test.txt' could not be copied because the destination directory 'public://subdirectory' is not properly configured. This may be caused by a problem with file or directory permissions.' contains 'The specified file 'public://test.txt' could not be copied to 'public://subdirectory/test.txt' because the destination directory 'public://subdirectory' is not properly configured. This may be caused by a problem with file or directory permissions.'.
    

    Which is good.

    Reading the comments seems the last point in #23 was addressed.

  • Status changed to Needs work almost 2 years ago
  • πŸ‡³πŸ‡ΏNew Zealand quietone

    Does this apply to a supported version of Drupal?

Production build 0.71.5 2024