Problem/Motivation

The page File system /admin/config/media/file-system contains the info about the file system but has missing information regarding the application root folder.

Steps to reproduce

Install the Drupal project on the shared hosting.

Proposed resolution

Introduce a description of the application root and add the info for relative paths with resolved absolute paths.

Remaining tasks

Add an item at File system page which describes the application root.
Decide how to provide additional info for the absolute paths and implement it.

User interface changes

The content of the page File system will be updated.

API changes

-

Data model changes

-

Release notes snippet

Initial summary

It is not always obvious what directory should be used for the private file system path, especially for sites on shared hosting.

It would be helpful to show the full path to the Drupal root directory on the file system admin form (/admin/config/media/file-system)

Issue fork drupal-2704931

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

malcomio created an issue. See original summary.

malcomio’s picture

Here's a patch against 8.0.x

malcomio’s picture

And here's a D7 patch.

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

mbaynton’s picture

I think the best practice for private files is to not even locate them under the installation root (see https://www.drupal.org/documentation/modules/file, managing file locations and access.) If we give a hint to the installation root here, maybe it should also say you don't need to use it. Perhaps "You can use any absolute writable path, or the following path within this Drupal installation: @privpath", and append sites/default/files/private to the DRUPAL_ROOT for @privpath?

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

vikashsoni’s picture

@mailomio i try to applied #3 and #2 patches but giving error would you please suggest me that how i will check it sharing screenshot .....

Madhu kumar’s picture

@mailomio even i am also facing same issue unable to apply patch , If am doing wrong let me know how to apply it properly.

voleger’s picture

Version: 8.9.x-dev » 9.3.x-dev

No feature request allowed over 8.9.x branch, updating target branch to 9.3.x

ankithashetty’s picture

The patch in #2 needed a reroll. Attaching a rerolled patch here, thanks!

Madhu kumar’s picture

Patch #16 applied cleanly and working as expected ,Provide Drupal root path on file system admin form. Sharing Screenshot for reference.

longwave’s picture

Why is this buried in the "private file system path" description? Wouldn't it be better to show it as its own item?

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

vikashsoni’s picture

Applied patch #16 applied successfully
After patch root directory description has been added in description
Thanks for the patch

longwave’s picture

Alternative approach that implements #18, with additional help text explaining what this means.

joachim’s picture

I think clearer than both approaches so far would be to add the DRUPAL_ROOT as a prefix to the displayed value.

longwave’s picture

@joachim if we are to do that we should just resolve the full absolute path of each value, rather than trying to figure it out ourselves - we don't want to prefix with DRUPAL_ROOT if the path is already absolute, for example.

heni_deepak’s picture

FileSize
161.66 KB

Applied patch #21 applied successfully

joachim’s picture

> if we are to do that we should just resolve the full absolute path of each value, rather than trying to figure it out ourselves

Maybe we should do that?

What's the actual purpose of this form? None of these paths can be edited in the form, can they? So, is the purpose here:

A. Show what is literally defined in settings.php
B. Show the location of the file folders

If it's B, then resolving it makes sense.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

smustgrave’s picture

Status: Needs review » Needs work
Issue tags: +Needs Review Queue Initiative, +Needs issue summary update

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.

This could use an issue summary update for the proposed solution. Seems there is still discussion going on so when the path forward is decided it should be added to the IS. Will help the committer.

voleger’s picture

smustgrave’s picture

Status: Needs review » Needs work
Issue tags: +Needs change record

Thanks!

Code wise I think it looks fine. Not sure if we will need a trigger_error for the new parameter or not.

This could use a simple change record though to announce the new parameter option.

voleger’s picture

Status: Needs work » Needs review

Added CR https://www.drupal.org/node/3341696
Updated constructor to handle new parameter addition.

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -Needs change record

Thanks think this good for committer review now.

quietone’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Usability, +Needs usability review, +Needs change record updates

This is changing the user interface, adding tag. As such this should have before and after screenshot available from the issue summary. This is also adding text to the public and private file descriptions, so I think this should have a usability review.

I read the change record, well several times, and I am still not sure what 'related' means in "public, private, and temporary paths are related". Tagging for a change record update. This is not a complicated change but a screenshot could be useful in the change record.

I skimmed the patch and made some comments. I also note this was set to RTBC with an unresolved comment.

voleger’s picture

Changed the relative paths with absolute as this will show the actual location of specific stream wrappers.
Added check for path accessibility. The realpath() file_system method fails absolute path resolving if the directory not exists.
I have added screenshots before, after, and after with warning messages.

smustgrave’s picture

Status: Needs review » Needs work
Issue tags: +Needs issue summary update

Brought this up in #ux channel and it was briefly looked at but was mentioned

taken a look but it would be helpful if the issue summary would have been updated illustrating the changes that will be made. at the moment the ui changes section only states The content of the page File system will be updated. . even if i apply a patch i consider it helpful to get an overview which changes were made.

voleger’s picture

I agree that IS needs to be updated, but please check the screenshots from #35.
The latest changes in MR convert paths to absolute if they are relative. And if the destination does not exist, the path value is printed as is (relative or absolute) with an appropriate warning message that reuses existing sentences and translations.
In case such behavior is acceptable I'll update IS as I can.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

voleger’s picture

Issue summary: View changes

rerolled
assets filesystem wrapper added since then
if #35 comparison approach is good to go with, I'm ready to create updated screenshots and attach them to the IS.