Commit Graph

47 Commits

Author SHA1 Message Date
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
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
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
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
Julian Seidenberg
22c7bbfcd4 NEW UploadField displays a warning before overwriting files (only relevant if config.yml: Upload:replaceFile = true). 2013-05-25 19:07:06 +12:00
Ingo Schommer
68af8409a5 Recursive folder creation in Upload 2013-05-13 15:47:34 +02:00
Ingo Schommer
3334eafcb1 API Marked statics private, use Config API instead (#8317)
See "Static configuration properties are now immutable, you must use Config API." in the 3.1 change log for details.
2013-03-24 17:20:53 +01:00
Ingo Schommer
083b6b2164 NEW Upload->replaceFile setting 2013-02-05 19:28:24 +01:00
Ingo Schommer
c55c7c33f8 Merge branch '3.0'
Conflicts:
	admin/code/CMSProfileController.php
	composer.json
	tests/model/DataObjectTest.php
2012-11-22 23:51:28 +01:00
Sean Harvey
e52db56ac8 Removing deprecated validator functions on Upload
Use Upload_Validator instead.
2012-11-15 14:43:14 +13:00
Sean Harvey
68826357cc BUG Fixing non-object on file upload
Upload::load() assumes that a parent Folder always exists for a file
upload, but that's not always the case, and a non-object error is
given if no parent folder.

Check the folder exists first before getting the ID.
2012-11-08 21:28:05 +13:00
Sam Minnee
1f7fc1f76a FIX Remove instances of lines longer than 120c
The entire framework repo (with the exception of system-generated files) has been amended to respect the 120c line-length limit.  This is in preparation for the enforcement of this rule with PHP_CodeSniffer.
2012-09-30 17:18:13 +13:00
Ingo Schommer
e2f073f38a Method visibility according to coding conventions 2012-09-20 10:46:59 +02:00
Sean Harvey
5462cdaab2 MINOR Removing "." from the end of validation messages 2012-06-01 13:13:06 +12:00
Ingo Schommer
7b18d9d0da MINOR Switching _t() calls from sprintf() to using injection parameters (#7170) 2012-05-01 22:17:00 +02:00
Ingo Schommer
d44f6b3e1f MINOR Removed deprecated usage of $priority argument in _t() calls 2012-04-15 17:17:17 +02:00
Simon Welsh
f07258f3cf MINOR Update @package values to match renaming sapphire 2012-04-15 10:50:19 +12:00
Ingo Schommer
40d73127ae MINOR Using late static binding instead of Object::create() calls 2012-04-04 17:10:31 +02:00
AngryPHPNerd
0e2cbb0b88 Replace ereg with preg_* 2012-02-27 22:14:02 +01:00
Stig Lindqvist
3c516b7b97 API CHANGE: Refactored GridField modifiers into GridField_ColumnProvider, GridField_HTMLProvider, GridField_ActionProvider, and GridField_DataModifier interfaces, all added as components in the config.
API CHANGE: Simplified state handling so that it's just a key store. Affectors are replaced with GridField_ActionProviders. API CHANGE: Removed GridField state manipulation actions instead opting for GridField_ActionProvider actions.
API CHANGE: Removed support for modifiers that add "body" rows, instead having core support for generating the body rows hardcoded into the GridField.
API CHANGE: Allow modification of columns across the whole GridField with the GridField_ColumnProvider interface.
API CHANGE: Renamed GridField_AlterAction to GridField_Action, and added actionName/args parameters, since it can be used for all actions (including batch actions and row actions)
API CHANGE: Removed GridFieldRow class.
2012-01-09 13:30:34 +13:00
Sam Minnee
e5afa25522 MINOR: Use Deprecation class to indicate deprecated methods in core. 2011-10-29 17:34:31 +13:00
Ingo Schommer
da0ac49d5f API CHANGE Rewriting underscores to dashes in files uploaded through Upload->load(), Folder->addUploadToFolder() or Image->loadUploadedImage(). Transliterating non-ASCII characters automatically (turn off via FileNameFilter::$default_use_transliterator=false)
ENHANCEMENT New FileNameFilter class for a more customisable way to influence filename filtering in Upload->load(), Folder->addUploadToFolder() or Image->loadUploadedImage()
2011-10-07 14:12:46 +02:00
Ingo Schommer
afeccbc9cb ENHANCEMENT Added File::get_class_for_file_extension() instead of hardcoding it in Folder->constructChild(). Allows for custom classes in files uploaded through core functionality like the Upload and FileField logic. 2011-10-07 14:12:45 +02:00
Carlos Barberis
184e8bd852 ENHANCEMENT: Added allowed actions to core classes 2011-02-14 11:14:51 +13:00
Ingo Schommer
07b6d1870a MINOR Checking for class_exists() before SapphireTest::is_running_tests() to avoid including the whole testing framework, and triggering PHPUnit to run a performance-intensive directory traversal for coverage file blacklists
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@114332 467b73ca-7a2a-4603-9d3b-597d59a354a9
2010-11-30 05:13:09 +00:00
Ingo Schommer
35b41709c2 MINOR Better presentation of extension error message in File and UploadValidator (from r107274)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@112565 467b73ca-7a2a-4603-9d3b-597d59a354a9
2010-10-15 03:21:04 +00:00
Ingo Schommer
122549ca60 MINOR Documentation (from r106804)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@112538 467b73ca-7a2a-4603-9d3b-597d59a354a9
2010-10-15 03:04:27 +00:00
Sam Minnee
2948bc1c64 MINOR: Misc merges from branches/2.4
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@112142 467b73ca-7a2a-4603-9d3b-597d59a354a9
2010-10-13 03:53:12 +00:00
Sam Minnee
81ce1e358d BUGFIX Fixed Upload and checking for size with files that don't have any extension (from r101061)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@111580 467b73ca-7a2a-4603-9d3b-597d59a354a9
2010-10-04 04:44:03 +00:00
Sam Minnee
2582608b34 MINOR No need for a ternary for in_array check in Upload::isValidExtension() (from r101055)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@111577 467b73ca-7a2a-4603-9d3b-597d59a354a9
2010-10-04 04:43:28 +00:00
Sam Minnee
0dcf75f965 MINOR Update function doc for Upload::isValidExtension() (from r101053)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@111575 467b73ca-7a2a-4603-9d3b-597d59a354a9
2010-10-04 04:42:54 +00:00
Sam Minnee
f9c888438d MINOR phpDoc change for Upload (from r101052)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@111574 467b73ca-7a2a-4603-9d3b-597d59a354a9
2010-10-04 04:42:39 +00:00
Sam Minnee
2ea0e3e331 BUGFIX #5188 Upload and Folder don't handle the duplicate naming of files that have no extension (from r101050)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@111572 467b73ca-7a2a-4603-9d3b-597d59a354a9
2010-10-04 04:42:13 +00:00
Ingo Schommer
16c93b1284 MINOR Made Upload::load() error more useful (from r100499)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@105582 467b73ca-7a2a-4603-9d3b-597d59a354a9
2010-05-25 04:04:20 +00:00
Ingo Schommer
ecb6c8cb3f BUGFIX: replacing calls to deprecated Upload functions - using validator instead (related to r100057) (from r100496)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@105581 467b73ca-7a2a-4603-9d3b-597d59a354a9
2010-05-25 04:03:46 +00:00
Ingo Schommer
75b98970e4 API CHANGE #5107 Upload now uses Upload_Validator to separate the validation rules from the File loading done in the Upload class (from r100057)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@105549 467b73ca-7a2a-4603-9d3b-597d59a354a9
2010-05-25 03:42:52 +00:00
Ingo Schommer
f86c05ba08 MINOR Reinstated UploadTest (from r99862)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@105540 467b73ca-7a2a-4603-9d3b-597d59a354a9
2010-05-25 03:18:49 +00:00
Ingo Schommer
6460d09570 MINOR Fixed phpdoc documentation
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@103385 467b73ca-7a2a-4603-9d3b-597d59a354a9
2010-04-23 00:11:41 +00:00
Ingo Schommer
6121cc4782 BUGFIX Validating $_FILES in Upload->validate()
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@73254 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-03-17 22:26:33 +00:00
Sean Harvey
4e0bf2c671 BUGFIX Fixed Upload::isValidSize() error if a file was uploaded without an extension
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@71559 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-02-09 23:02:46 +00:00
Sean Harvey
d145c50cc2 ENHANCEMENT Folder name can now be used for uploading files. Ticket #3026 - Thanks simon_w!
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@65266 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-05 03:56:22 +00:00
Ingo Schommer
5927bf2399 BUGFIX Fixed Upload->isValidExtension() - was checking array keys instead of array values ....
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@63467 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-10-01 18:31:08 +00:00
Ingo Schommer
9371f4688b ENHANCEMENT Introduced constants for system paths like /sapphire in preparation for a more flexible directory reorganisation. Instead of hardcoding your path, please use the following constants: BASE_PATH, BASE_URL, SAPPHIRE_DIR, SAPPHIRE_PATH, CMS_DIR, CMS_PATH, THIRDPARTY_DIR, THIRDPARTY_PATH, ASSETS_DIR, ASSETS_PATH, THEMES_DIR, THEMES_PATH
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@63154 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-09-27 16:02:38 +00:00
Ingo Schommer
1c929747ce Merged revisions 47623 via svnmerge from
svn://svn.silverstripe.com/silverstripe/modules/sapphire/branches/2.2.0-mesq

........
  r47623 | ischommer | 2008-01-04 21:44:51 +1300 (Fri, 04 Jan 2008) | 1 line
  
  fixed extension checking
........


git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@52400 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-04-09 11:13:24 +00:00
Ingo Schommer
b465a46bcc API CHANGErefactored upload functionality from File into newly created Upload class
API CHANGE deprecated some File functions and attributes
API CHANGE moved management function from File to Filesystem and added permission checks: sync(), loadContent(), fixfiles(), moverootfilesto()
API CHANGE deprecated use of File->loadUploaded()
ENHANCEMENT added filesize and extension validation to AssetAdmin and FileField
FEATURE added tests for Upload class

Merged revisions 47617 via svnmerge from 
svn://svn.silverstripe.com/silverstripe/modules/cms/branches/2.2.0-mesq

........
  r47617 | ischommer | 2008-01-04 19:20:29 +1300 (Fri, 04 Jan 2008) | 5 lines

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@52205 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-04-06 08:20:13 +00:00