Needs review
Project:
Backup Database
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
15 Mar 2016 at 08:01 UTC
Updated:
4 Oct 2017 at 17:32 UTC
Jump to comment: Most recent, Most recent file

Comments
Comment #2
swim commentedAre you exporting to your private file schema while having not defined a private schema yet?
Comment #3
swim commentedPlease reopen if you are still having issues.
Comment #4
Alex Andrascu commentedThis is indeed happening using default settings with Path set to public://backup_db
Attached patch fixes it.
Comment #5
Alex Andrascu commentedOops .module file added to patch by mistake. Patch re-attached.
Comment #6
swim commentedLegend, thanks for reporting / looking at this. Could you perform one additional check please? Could you test this patch with the private:// schema? We might need another condition based on the schema type.
Comment #7
Alex Andrascu commentedTrue, it now breaks the private schema. I'll be looking into it some point this week .
Comment #8
Alex Andrascu commentedComment #9
Alex Andrascu commentedAlso if you have some spare time you can experiment with this.
Move the url logic to .module like so:
use Drupal\Core\Url;... etc etc
change the controller historyOverview like so:
It will now generate the correct download links but you'll get an access denied if you try downloading the private one.
I don't have enough time to commit to it at the moment but if you do I think we're on to something here. Otherwise I'll pick it up later.
Comment #10
osmanHere's a patch based on Alex's suggestion from #9.
However, since
<?php Url::fromUri(file_create_url($uri)) ?>actually works for both `public` and `private` schemes, and it hasn't been used anywhere else I removed the<?php backup_db_link() ?>function.I tested with both schemes, links are generated correctly.
I too get access denied error for private file download requests though.
Comment #11
osmanComment #12
osmanbtw, I tried Private files download permission module to bypass access issues.
It seems that it can enable private file downloads without compromising access rules for rest of the private files: