Commit 85a421eb authored by webchick's avatar webchick

Issue #966210 by mfb, catch, bfroehle, drewish, drumm, makara, sun, BTMash,...

Issue #966210 by mfb, catch, bfroehle, drewish, drumm, makara, sun, BTMash, iamEAP: Fixed DB Case Sensitivity: system_update_7061() fails on inserting files with same name but different case.
parent 48f271b6
......@@ -862,6 +862,7 @@ function system_schema() {
'length' => 255,
'not null' => TRUE,
'default' => '',
'binary' => TRUE,
),
'uri' => array(
'description' => 'The URI to access the file (either local or remote).',
......@@ -869,6 +870,7 @@ function system_schema() {
'length' => 255,
'not null' => TRUE,
'default' => '',
'binary' => TRUE,
),
'langcode' => array(
'description' => 'The {language}.langcode of this file.',
......
......@@ -2042,6 +2042,19 @@ class FileSaveTest extends FileHookTestCase {
$this->assertNotNull($loaded_file, t("Record still exists in the database."), 'File');
$this->assertEqual($loaded_file->status, $saved_file->status, t("Status was saved correctly."));
$this->assertEqual($loaded_file->langcode, 'en', t("Langcode was saved correctly."));
// Try to insert a second file with the same name apart from case insensitivity
// to ensure the 'uri' index allows for filenames with different cases.
$file = (object) array(
'uid' => 1,
'filename' => 'DRUPLICON.txt',
'uri' => 'public://DRUPLICON.txt',
'filemime' => 'text/plain',
'timestamp' => 1,
'status' => FILE_STATUS_PERMANENT,
);
file_put_contents($file->uri, 'hello world');
file_save($file);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment