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
fix: default file/uploads location for Silverstripe #5241
fix: default file/uploads location for Silverstripe #5241
Conversation
Download the artifacts for this pull request:
See Testing a PR |
Seems so far the Colima tests just crashed. No big deal though, it's a 3-liner. @rfay I noticed that the I don't mind either way, but multiple PRs for just Silverstripe project-type related minor fixes feels a tad overkill? edit |
Separate PR, but anything you can do to improve the formatting is welcome. It's a real balancing act trying to make it work for the most possible situations. I do actually hate to make that column wider because it will make it work worse for more people (going past 80 characters, etc.) |
54ced90
to
81a1455
Compare
Rebased and the requisite PR is now pulled, so please check it over and take a look at the silverstripe files tarball. Thanks! |
I'll try to make some time free for it! But no promises... Life is surely getting in the way at the moment :) |
I've added a very basic test that checks if the upload dir is at least not empty. I'm a tad short on time right now, but I'm trying to get the tests to match an actual expectation instead of only "not empty" *edit |
It's this one, the Colima test indeed :) : |
c401b74
to
52a62a4
Compare
When you're ready for review, change to "Ready for review", thanks! |
52a62a4
to
a2b2a87
Compare
Rebased. I hope things have calmed down now @Firesphere and that the new life is great! Let me know if you want to go forward with this one. |
I'll close this about Oct 1 if it doesn't get attention, thanks @Firesphere . After that it can be reopened when you are ready to return to it. |
Apologies, both work and personal life are very stressful and busy at the moment. I'll get back to tidying this up probably not before mid October |
a2b2a87
to
7076e06
Compare
Update, got some spare time. I think this is what I completely intended to achieve. Set the upload dir, and test for the known project types that have an upload dir, that it is what is expected from default settings. |
Thanks. I know what it's like to have too much else to do. Wasn't trying to pressure you, just try to keep things moving so it doesn't get too messy around here. |
Sorry, this got lost in the older PRs and now I'm less available next few weeks. Will try to get it reviewed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested it with:
mkdir my-silverstripe-app
cd my-silverstripe-app
ddev config --project-type=silverstripe --docroot=public --create-docroot
ddev composer create --prefer-dist --no-scripts silverstripe/installer -y
mkdir my-assets && touch my-assets/asset.txt
ddev import-files --source=my-assets
Error: failed to import files for my-silverstripe-app: unable to import to /home/stas/code/ddev/my-silverstripe-app/public/public/assets: parent directory does not exist
But it tries to use public/public/assets
. I believe it is because --docroot=public
I used quickstart https://ddev.readthedocs.io/en/latest/users/quickstart/#silverstripe
Hm, okay, I did not expect that :D . I'll have a look. Cheers! |
It was a tad dumb of me, the upload dir is indeed relative to the public dir, and it was indeed creating A "simple" matter of not including |
Thanks for the followup! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Let me know when you're happy with it and I'll pull.
As far as I'm concerned/aware, it's good to go. It has all the tests and solves the original problem mentioned in #5234 |
@stasadev can take a look tomorrow and in it goes! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
The Issue
ddev import-files
on Silverstripe does not have a default import location set.How This PR Solves The Issue
Adds a default UploadDirs method to Silverstripe, so the default (
public/assets
) is properly detected.Manual Testing Instructions
Run an import of assets.
Automated Testing Overview
Added a test which checks for each known
getUploadDirs
method, if the return matches a set of default expected values.Related Issue Link(s)
Depends on
Release/Deployment Notes