Closed (fixed)
Project:
Configuration development
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
27 Aug 2015 at 01:22 UTC
Updated:
19 Oct 2017 at 12:30 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
benjy commentedI've run into this as well, heres a patch that always tries to create the folder.
Comment #3
chx commentedwell, perhaps on a dev site the permissions are set so this can happen (certainly wouldn't in my setup but w/e) but I think we need a try-catch or something to handle errors? What happens when this mkdir fails anyways?
Comment #4
benjy commentedI believe mkdir currently returns FALSE when it fails, but it returns FALSE when the folder already exists as well. I'll have a go at improving the overall flow to give some more useful feedback.
Comment #5
gambryAdding a try/catch block on
mkdir()doesn't solve the problem as errors are raised on creating the files (and also for any other reason like write permission on the created folder, available space, etc.).I would suggest to add the patch above as it is and extending the try/catch block on writeBackConfig().
Patch at #2 works on 1.0-beta16 but not on 1.x anymore.
Comment #6
benjy commentedHow about this, check for the directory first, then try create it. Un-tested because my drush was playing up but i'll get that sorted later and give it a whirl. Feedback welcome.
Comment #7
pfrenssenWorks great, but there could be a small improvement: if the directories could not be created (e.g. due to a permissions problem) then a notice is logged but this is not shown to the end user. The command just exits silently without an error code, making it look like everything went fine, even though nothing was exported. Let's just change it to a
drush_set_error()so that an error is shown to the user and an error code is returned.Comment #10
joachim commentedThanks everyone!
This is a nice -- current behaviour is a crash:
which I would call a bug.