Commit Graph

459 Commits

Author SHA1 Message Date
Daniel Hensby
5f0d0ab66a Merge pull request #4155 from kinglozzer/pulls/getfiletype-case
FIX: File::getFileType() was case sensitive (fixes #3631)
2015-07-28 00:13:26 +01:00
Damian Mooyman
21e891e28c Merge pull request #4200 from cwchong/3.1
Bug fix: File->setName()
2015-06-18 16:37:56 +12:00
Damian Mooyman
b42ddd107c Merge pull request #3499 from colymba/ie-multi-file-upload-fix
FIX #3458 iframe transport multi file upload FIX #3343, FIX #3148
2015-06-09 13:22:10 +12:00
Jonathon Menz
a56d08b1ae FIX: TreeDropdownField Folder expansion
When viewing a Folder tree, an expansion icon was shown if the Folder had *any* children, but it should be restricted to children that are Folders.
2015-05-27 09:22:42 -07:00
cwchong
dc24d3f21f Bug fix: File->setName()
Logical error. $base should use PATHINFO_FILENAME instead of
PATHINFO_BASENAME in order to exclude extension; final $name should
include a period before $ext as $ext uses PATHINFO_EXTENSION which
excludes the period.
2015-05-19 13:43:00 +08:00
Loz Calver
1cca37c908 FIX: File::getFileType() was case sensitive (fixes #3631) 2015-05-04 15:10:16 +01:00
Damian Mooyman
8e24511266 BUG Fix users with all cms section access not able to edit files
Fixes #4078
2015-04-20 18:20:56 +12:00
wernerkrauss
033582abcc Fixed typo in HtmlType translation key 2015-03-10 11:24:03 +01:00
Christopher Darling
2da0ebe148 Renamed IMagickBackend to ImagicBackend
Also updated config:: to Config:: on line #52
2015-02-27 11:19:09 +00:00
Damian Mooyman
7816875e92 Fix file and uploadfield permissions 2015-01-12 10:56:25 +13:00
Damian Mooyman
644f38f2d6 Merge pull request #3726 from willmorgan/bugfixes/gd-image-exists
FIX: GD - check file exists before getimagesize
2014-12-12 08:30:39 +13:00
Will Morgan
b5c361a66c FIX: GD - check file exists before getimagesize
Use is_readable to check the file exists and is readable
2014-12-11 15:21:38 +00:00
JorisDebonnet
af47a63322 File.php: support for MS Office template / macro files
Fixes #3692
2014-12-04 21:57:31 +01:00
Jeremy Shipman
392ddef2e8 FIX: Image resizing breaks when one of the resized image dimensions is between 0 and 1.
Solution: Round up to 1 instead of down to 0.
Converted php errors to exceptions in the process.
2014-10-30 14:21:04 +13:00
Devlin
478edfa0c6 BUG Upload: File versioning with existing files
reinsert oldFilePath = relativeFilePath in while loop
2014-10-22 08:48:55 +13:00
Thierry François
bbc1cb8270 FIX #3458 iframe transport multi file upload FIX #3343, FIX #3148
UploadField now handles multiple file upload through iframe transport
correctly (mainly for IE) as well as upload errors on a per file basis.
2014-09-26 10:48:41 +03:00
Sean Harvey
6d12cf372e Merge pull request #2921 from JayDevlin/2904-upload-file-versioning
BUG Upload: file versioning uses illegal underscore in filename
2014-09-24 15:59:53 +12:00
Sean Harvey
8bd867ef4e Merge pull request #3334 from jedateach/fixes/imagick-padresize
Image Magick PaddedResize fix
2014-08-19 14:19:13 +12:00
Jeremy Shipman
bf3ad56674 FIX: Image_Backend -> croppedResize function doesn't include a backgroundColor, therefore this shouldn't be assumed in ImageMagick->croppedResize 2014-08-19 12:24:45 +12:00
Jeremy Shipman
02265dc3c4 FIX: Correctly paddedResize images in IMagickBackend.
FIX: Compression quality setting now takes effect.

fixes #3333
2014-08-19 12:24:07 +12:00
Jeremy Shipman
47cc157d97 FIX: Keep ImagickBackend API consistent with Image_Backend interface and fix color formatting. 2014-08-19 12:24:07 +12:00
Sean Harvey
5491a5dadc Use Injector to create default Upload_Validator instance
Allows this class to be swapped out with a custom Upload_Validator
globally, without having to call Upload::setValidator() everywhere.
2014-07-28 16:28:38 +12:00
Hamish Friedlander
8e841cc471 FIX folder Title not being exactly the same as Name field if setName modified the value 2014-05-02 14:41:10 +12:00
Stephen Holdaway
3be01968ec Delete formatted images after image upload
This change fixes an issue where old/existing formatted images are used
when a filename is reused (by overwrite or by coincidence), regardless
of if the file contents have changed. To users this mainly manifests
as a file overwrite appearing not to work; the thumbnails in the CMS
show the original image until regeneration is forced.

Calling Image::deleteFormattedImages() after image upload ensures that
no stagnant formatted images will be used.
2014-04-08 14:33:44 +12:00
Nathan Glasl
398e5bc688 Cast TreeTitle to HTMLText
Closes #2989
2014-03-30 18:01:05 +13:00
Devlin
0096ab0d3d Upload: refactor file versioning 2014-03-24 11:45:37 +01:00
Simon Welsh
d28a323fbd Merge pull request #2941 from torleif/patch-3
Updated find_or_make() documentation
2014-03-15 21:55:06 +13:00
Simon Welsh
279b927df1 Merge pull request #2903 from tractorcow/pulls/fix-fileupload-fileexists
BUG Fix issues with uploading to /assets
2014-03-15 21:02:36 +13:00
torleif
76e689b8c0 Updated find_or_make() documentation
See: https://github.com/silverstripe/silverstripe-framework/pull/2903#issuecomment-37252948
2014-03-11 14:26:08 +13:00
Devlin
3c1e82b42c Upload: retrieve existing File if an object without an ID is given and replaceFile=true 2014-03-04 18:02:33 +01:00
Damian Mooyman
c1e0f98f87 BUG Fix case where setFolder('/') would break UploadField::fileexists
BUG Prevent Upload from writing to the site root folder
2014-02-27 14:23:32 +13:00
Igor
3e5ac7cdcc Update File.php
Adding warning, took me a couple hours to figure this out...

The file does not get moved because of this line:
https://github.com/silverstripe/silverstripe-framework/blob/3.1/filesystem/File.php#L515

Maybe add to the method doc, telling people to set ParentId and Name instead if they want to change the location of a file (if that's the correct method).
2014-02-26 14:09:09 +13:00
Damian Mooyman
ebeb663ddf BUG Fixed critical issue with Folder::find_or_make failing to handle invalid filename characters
BUG Fix UploadField duplicate checking with invalid folderName
2014-02-21 09:11:34 +13:00
Ingo Schommer
caecc05b0b Upload path regression caused by 3d24079 2014-02-19 16:39:10 +13:00
Ingo Schommer
3d24079d15 Use filtered file paths in upload (fixes #2836) 2014-02-09 19:24:09 +13:00
Ingo Schommer
124886a7f9 Merge pull request #2799 from yearofthegus/document-magic-members
Documented magic properties of DataObject
2014-01-30 18:26:23 -08:00
Ingo Schommer
ab070944d5 Merge branch 'pulls/apidocs-package-list' of https://github.com/madmatt/silverstripe-framework into madmatt-pulls/apidocs-package-list
Conflicts:
	view/SSTemplateParser.php
	view/SSTemplateParser.php.inc
2014-01-31 15:15:59 +13:00
Gus King
5797efa263 Documented magic properties of DataObject 2014-01-26 00:11:32 -05:00
Will Rossiter
0b22ca6c59 FIX: Ignore current instance when checking for duplicate records (Fixes #1927) 2014-01-12 20:54:55 +13:00
madmatt
bebe0f6e37 Updating @package and @subpackage doc tags 2013-11-29 17:49:30 +13:00
colymba
19928ff5e8 NEW GDBackend can save interlaced image
Disabled by default use config GDBackend.image_interlace: 1 to enable
2013-10-19 14:46:23 +03:00
unclecheese
b1ad10a42b BUGFIX: Without casting TreeTitle as HTMLText, unescape HTML appears in TreeDropdownField 2013-09-27 14:46:17 +12:00
tazzydemon
ca2e7dad49 Update ImagickBackend.php 2013-08-25 11:37:00 +12:00
Simon Welsh
151baeede1 Correct line length and indentation 2013-08-21 18:54:05 +12:00
CheeseSucker
3d9e12baf4 ENHANCEMENT: Allow programmers to set OwnerID for new files.
NOTE: This change should be reviewed to make sure it does not cause any side effects.

Example use case: 
    An admin porting user images from an old website.
    The script would put the images in the assets folder,
    and then insert them into the database using Image::write()
    and data from the old database.

public function insertImage($data) {
    $image = new Image();
    $image->ParentID = $data->parentId;
    $image->Title = $data->title;
    $image->FileName = $data->filename;
    $image->OwnerID = $data->ownerId;
    $image->write();
    
    // In the current version, this results in all images
    // being owned by Member::currentUser() instead of 
    // the expected $data->ownerId;
}
2013-06-14 18:30:09 +02:00
CheeseSucker
6ce2a90f19 Fixes a translation issue where a parameter isn't replaced.
Whenever File::Validate() failed due to an illegal file extension, it printed the translated message without replacing the parameter {extensions}.
2013-06-14 00:08:44 +03:00
Ingo Schommer
fbfcb6d8aa New video formats in allowed_extensions
See https://github.com/silverstripe/silverstripe-installer/pull/41
2013-05-29 18:22:47 +02:00
Ingo Schommer
4b21f9f6ad Merge branch '3.1-uploadfield-enhancement' of git://github.com/tractorcow/sapphire into tractorcow-3.1-uploadfield-enhancement 2013-05-29 17:11:15 +02:00
Daniel Hensby
295f76e331 FIX Making path names consistent
I've changed the variables to use the absolute path as the path is unhelpful for debugging and this is more consistent with the other lines of code below
2013-05-28 19:08:59 +02:00
Damian Mooyman
7f057ce343 API UploadField functions on new records
Fixed regression from 1e5d40474d (UploadField::canPreviewFolder).
Merged in pull request #2009 - (6018bdd631).
Merged pull request #1259 (34bfc862ee).
2013-05-27 15:22:59 +12:00