Closed (fixed)
Project:
Patterns
Version:
7.x-1.0-rc1
Component:
Code
Priority:
Minor
Category:
Task
Assigned:
Reporter:
Created:
30 Oct 2012 at 12:11 UTC
Updated:
14 Nov 2012 at 11:47 UTC
Jump to comment: Most recent file
The function _patterns_io_file_has_valid_extension() is called twice, we can probably then remove it on the parent function since it is ensured in the inner one:
includes/forms/import.inc - l.360
// Add the extension if missing or invalid
if (!_patterns_io_file_has_valid_extension($name)) {
$name = $name . '.' . $format;
}
includes/io/io.inc - l.395
// Check if the file has a valid extension
// and in case add the format at the end
if (!_patterns_io_file_has_valid_extension($name)) {
$name = $name . '.' . $format;
}
As Stefano suggested we should be careful about this: "Some function calls are a bit entangled, so we must be careful in removing double checkings. Require testings, if you remove it".
I will create a branch of the code at github, take a look to remove it and test if no other functions get affected. I will provide a patch if everything is ok.
Cheers,
David
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | issue-1826916.patch | 1.06 KB | drozas |
Comments
Comment #1
drozasComment #2
drozasHi all,
Please find attached the patch solving the problem. I will also merge and push the changes at git@github.com:QScience/Patterns.git
Regards,
David
Comment #3
drozasI'll mark this as fixed, the patch has been included in patterns 7.x-1.0-rc2 release.
Comment #4
drozas