Closed (fixed)
Project:
Panopoly
Version:
7.x-1.x-dev
Component:
Tests / Continuous Integration
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
15 May 2014 at 20:52 UTC
Updated:
2 Sep 2014 at 17:50 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
cboyden commentedComment #2
dsnopekHere's the first pass at a patch to implement this. I've tested it locally on a site without a private path setup and it worked for me! I'm also going to try on Travis-CI in a moment.
@cboyden: Can you try this patch in your environment?
Comment #3
cboyden commentedI'm getting an exception on a fresh install of latest Panopoly:
"Files must be configured for @drupal_private_files tests to work!"
When I go to admin/config/media/file-system, I see sites/default/files in the "Public file system path" field. But, if this form has never been saved in the UI, it isn't in the variables table. So variable_get can't find it and thinks it's empty.
Comment #4
cboyden commentedComment #5
dsnopekBlergh! I always configure my files paths with settings.php (which is how my local dev site is setup too), so I didn't take into account a site that wouldn't have that setup BUT still have a working files configuration.
I'll find where it's calculating it's default value and pull that code in too...
Comment #6
dsnopekThe fix was super simple - just pulled in the same default from system.admin.inc. Getting it properly tested, however, took a little bit. :-)
Try this patch!
Comment #7
cboyden commentedCool! One more question: Can the private file path be set by a method that does not make it appear in the variables table? If so, we'd have to add the same check for that as you've just added for the public file path.
Comment #8
dsnopekHrm. The only other way would be overwritting the site's settings.php, which we really shouldn't have permission to do in any sane environment. :-)
I'm not sure what you mean. I didn't add a check, just a default. And the private path doesn't have a default, since Drupal can't guess a path that isn't accessible to the webserver.
Comment #9
cboyden commentedThis test passes on Chrome (it's already tagged @chrome, so no surprise that it does not pass on Firefox).
It works under both conditions - variable set or unset - and unsets the variable correctly after the test if it started off unset.
The point of my previous question was, is there any chance that the site under test has already set the private file directory in a way that does not show up in the variables table? Because if it does, the test will wipe that setting out.
Comment #10
dsnopekOooh. No, I don't think so. There is no default for file_private_path, it has to get setup manually. And if the user used the settings.php to set file_private_path (or manipulated $conf manually), it would actually override what's on the variables table, not the other way around.
I think we're fine here. That is, until someone reports a problem with a case I didn't think of. :-) But, yeah, I can't think of anything that could go wrong at the moment.
Comment #12
dsnopekCommitted!
Comment #13
cboyden commentedFor anyone following along at home: the commit ended up being a bit different. I've attached a patch that matches the commit.