Commit 664d391c authored by Drew Webber's avatar Drew Webber
Browse files

Issue #2128055 by slashrsm, anavarre, timhilliard, estoyausente, nielsvm,...

Issue #2128055 by slashrsm, anavarre, timhilliard, estoyausente, nielsvm, effulgentsia, zopa, rteijeiro, rootwork, stijntilleman, vijaycs85, jonhattan, DamienMcKenna, Crell, webchick, Dave Reid, attiks, Fidelix, toamit, Pls, meba, YesCT, saltednut, erwangel: Files should be uploaded to per year/month directories by default
parent c2a0ff7c
Loading
Loading
Loading
Loading
+1 −1
Changes for modules/file/file.field.inc: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@ function file_field_info() {
      ),
      'instance_settings' => array(
        'file_extensions' => 'txt',
        'file_directory' => '',
        'file_directory' => '[date:custom:Y]-[date:custom:m]',
        'max_filesize' => '',
        'description_field' => 0,
      ),
+3 −2
Changes for modules/file/tests/file.test: 3 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -1354,10 +1354,11 @@ class FileFieldPathTestCase extends FileFieldTestCase {
    // Create a new node.
    $nid = $this->uploadNodeFile($test_file, $field_name, $type_name);

    // Check that the file was uploaded to the file root.
    // Check that the file was uploaded to the correct location.
    $node = node_load($nid, NULL, TRUE);
    $node_file = (object) $node->{$field_name}[LANGUAGE_NONE][0];
    $this->assertPathMatch('public://' . $test_file->filename, $node_file->uri, format_string('The file %file was uploaded to the correct path.', array('%file' => $node_file->uri)));
    $expected_path = 'public://' . date('Y', REQUEST_TIME) . '-' . date('m', REQUEST_TIME) . '/' . $test_file->filename;
    $this->assertPathMatch($expected_path, $node_file->uri, format_string('The file %file was uploaded to the correct path.', array('%file' => $node_file->uri)));

    // Change the path to contain multiple subdirectories.
    $field = $this->updateFileField($field_name, $type_name, array('file_directory' => 'foo/bar/baz'));
+1 −1
Changes for modules/image/image.field.inc: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -19,7 +19,7 @@ function image_field_info() {
      ),
      'instance_settings' => array(
        'file_extensions' => 'png gif jpg jpeg',
        'file_directory' => '',
        'file_directory' => '[date:custom:Y]-[date:custom:m]',
        'max_filesize' => '',
        'alt_field' => 0,
        'title_field' => 0,
+1 −1
Changes for profiles/standard/standard.install: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -356,7 +356,7 @@ function standard_install() {
    'required' => FALSE,

    'settings' => array(
      'file_directory' => 'field/image',
      'file_directory' => '[date:custom:Y]-[date:custom:m]',
      'file_extensions' => 'png gif jpg jpeg',
      'max_filesize' => '',
      'max_resolution' => '',