I've a multisite config and I decided to hardcode (i.e variable override) in settings.php the file_directory_path for each domain:

$conf = array (
'file_directory_path' => 'sites/rizoma.org/files',
);

..to avoid site-admins to change it. But It can be changed and after submission:

* The directory sites/rizoma.org/files2 has been created.
* The configuration options have been saved.

although the value returns back to the settings.php defined. So the bug is not checking this field is hardcoded prior to make the directory.

I've been looking the code with no success. I think it's a drupal design issue that the directory must be created before the config is saved (and in this point it's checked the value can't be changed because it's hardcoded in setttings.php).

So instead of going deep inside flow control, I think the solution is to advert in the form that this value is hardcoded and can't be changed (i.e. a readonly field or like). This also will avoid headaches to admin's that don't know nor control settings.php.

CommentFileSizeAuthor
#8 file_57979-8.patch1.62 KBchx

Comments

pfaocle’s picture

Version: 4.7.0-rc2 » 4.7.0

I think the solution is to advert in the form that this value is hardcoded and can't be changed (i.e. a readonly field or like). This also will avoid headaches to admin's that don't know nor control settings.php.

+1 for disabling the files field on admin -> settings when $conf is set (this can be done easily with Forms API)

Drupal creating the folder specified on this page regardless of $conf is a bug still present in 4.7.0, as far as I can see.

magico’s picture

Version: 4.7.0 » x.y.z

Confirmed. The ?q=admin/settings/file-system should be disabled saying that it is already configured through the settings.php file.

This is a bug because it creates the directory, and it should not do that at least.

magico’s picture

Title: settings.php variable overrides & admin settings » File system administration creates directory despite the settings.php configuration
Component: system.module » file system
magico’s picture

Title: File system administration creates directory despite the settings.php configuration » File system administration should not create files directory

(I must practice my english)

coreb’s picture

Version: x.y.z » 4.7.x-dev

(Moving x.y.z version to a real version number)

I don't know if this is bug should be in this branch or the 5.x-dev branch.

Uwe Hermann’s picture

Any updates on this? Does it affect 5.x, too?

xqus’s picture

Version: 4.7.x-dev » 6.x-dev

I just confirmed this bug in HEAD.
Problem is, as far as I know is that there is no easy way to know if the setting has been hard coded, so you don't know if the field should be disabled or not.
Please correct me if I'm wrong.

A simple (and dirty?) workaround is to set
define('FILE_CREATE_DIRECTORY', 0);
in your settings.php file.

chx’s picture

Status: Active » Needs review
StatusFileSize
new1.62 KB

Let's try this.. might lead to false positives but not likely.

drewish’s picture

chx's patch would probably do the job but i think it's a bad precedent to set. unless we're going to do that for all the admin settings i don't think it's good to do it for just one.

dpearcefl’s picture

Status: Needs review » Postponed (maintainer needs more info)

Is this still a problem in current D6?

dpearcefl’s picture

Status: Postponed (maintainer needs more info) » Needs work

We want your patch if it is still needed. Please resubmit it with a proper filename.

http://drupal.org/node/1054616
[description]-[issue-number]-[comment-number].patch

Status: Needs work » Closed (outdated)

Automatically closed because Drupal 6 is no longer supported. If the issue verifiably applies to later versions, please reopen with details and update the version.