Problem/Motivation

When a file uri is defined to exist directly under "public://" directory, there is a weird behavior. A "web/public:" directory is being created!

Steps to reproduce

# Create an article with a photo "photo.jpg";
# Export the content;
# Manually edit the exported yaml file for the file to have the uri with value "public://photo.jpg";
# Install from scratch and enable default_content to have the importation running;
# Check that a "web/public:" directory was created.

Proposed resolution

Use the drupal dirname method instead of the PHP dirname. This alone will fix the problem.

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:

Comments

dxvargas created an issue. See original summary.

dxvargas’s picture

Status: Active » Needs review

I have created a MR with some fails but (as I understand) they are unrelated and the MR can be merged.
Asking for review.

saidatom’s picture

Status: Needs review » Reviewed & tested by the community

Great! Looks good, moving to RTBC.

berdir’s picture

Assigned: dxvargas » Unassigned
Status: Reviewed & tested by the community » Fixed

Thanks for the fix. Pretty sure I've seen this too and was wondering where it came from.

Added to merge train.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

  • berdir committed 04fd0586 on 2.0.x authored by dxvargas
    feat: #3501897 Importation of file is creating a public: directory
    
    By:...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.