Commit Graph

2464 Commits

Author SHA1 Message Date
Sam Minnee
aeccb8b8e0 API: Move DBField subclasses into SilverStripe\Model\FieldType namespace
API: Deprecate SS_Datetime.

The DBField subclasses are have all been renamed to start with “DB” and
be in the SilverStripe\Model\FieldType namespace. To keep DataObject
definitions concise, the original short variations of their names are
preserved as service definitions. Most of the field generation code
doesn’t need to change, but where field classes are referenced directly,
changes will be needed.

SS_Datetime, which is commonly referenced outside the model system
itself, has been preserved as a subclass of DBDatetime. This has been
marked as deprecated and can be removed in SilverStripe 5.

A few places that referred to $db and $casting values weren’t using
the Injector to instantiate the relevant classes. This meant that the
remapping we have created as part of moving classes into a namespace
didn’t work.
2016-03-22 18:09:30 +13:00
Ingo Schommer
8ae794ee99 API TinyMCE Image shortcodes 2016-03-21 09:23:40 +13:00
Damian Mooyman
3dada00905 Cleanup trailing whitespace 2016-03-09 10:20:31 +13:00
Damian Mooyman
6d88caa9b3 Merge pull request #5132 from open-sausages/features/form-schema
API Form schema
2016-03-07 14:08:36 +13:00
Ingo Schommer
627fbf9051 Fixed merge regression 2016-03-07 10:17:15 +13:00
Ingo Schommer
3b11d73c46 Merge remote-tracking branch 'origin/3'
# Conflicts:
#	forms/gridfield/GridFieldDetailForm.php
#	javascript/GridField.js
2016-03-07 09:26:35 +13:00
Ingo Schommer
61a8529d76 More reuseable FormSchema logic, return on save 2016-03-03 13:36:51 +13:00
Ingo Schommer
e1fcc64c41 Form field schema state
See https://github.com/silverstripe/silverstripe-framework/issues/4938
2016-03-03 13:36:48 +13:00
Ingo Schommer
746322a9f1 Replace CMSForm use with new setValidationResponseCallback() API
Preparing for form schema API, see https://github.com/silverstripe/silverstripe-framework/issues/4938
2016-03-03 08:20:55 +13:00
David Craig
404ac4ae43 Initial schemaState implementation 2016-03-03 08:20:54 +13:00
David Craig
afccef718c Initial Form Field Schema implementation
- Adds FormSchema class
- Adds FormSchema dependency to LeftAndMain via Injector
- Adds schema allowed_action method to LeftAndMain for generating Form schemas
- Adds FormFieldSchemaTrait to for schema getters and setters on FormFields
2016-03-03 08:20:54 +13:00
Matthew Hailwood
5810ecf7b9 Populate foreign key before getting CMS fields
In it's current state you need to revert to something like `Session::get('CMSMain.currentPage')` to get the foreign key of what the item you are creating relates to (e.g. a Book => has_many Author) - if you create a new Author you may need to reference the owning Book in the `getCMSFields` function.

This is just a small quality of life buff that populates that foreign key before calling `getCMSFields()` rather than after.

This should not break backwards compatibility in any way and isn't exactly a new feature so could be considered a bug fix.
2016-02-28 20:56:10 +13:00
Damian Mooyman
3b0a9f4ba2 Merge remote-tracking branch 'origin/3'
# Conflicts:
#	admin/javascript/LeftAndMain.Menu.js
#	control/HTTPRequest.php
#	css/GridField.css
#	css/GridField.css.map
#	docs/en/02_Developer_Guides/03_Forms/Field_types/01_Common_Subclasses.md
#	docs/en/02_Developer_Guides/06_Testing/00_Unit_Testing.md
#	docs/en/02_Developer_Guides/06_Testing/index.md
#	docs/en/02_Developer_Guides/14_Files/01_File_Management.md
#	docs/en/02_Developer_Guides/14_Files/02_Images.md
#	filesystem/Upload.php
#	javascript/HtmlEditorField.js
#	model/Image.php
#	model/connect/MySQLDatabase.php
#	model/fieldtypes/Enum.php
#	model/versioning/Versioned.php
#	scss/GridField.scss
2016-02-25 14:51:59 +13:00
Damian Mooyman
9fed5561f4 Merge remote-tracking branch 'origin/3.3' into 3
# Conflicts:
#	core/Constants.php
#	dev/DevelopmentAdmin.php
2016-02-24 17:39:04 +13:00
Damian Mooyman
e2c77c5a8f [ss-2016-002] Ensure Gridfield actions respect CSRF 2016-02-24 11:33:53 +13:00
Damian Mooyman
510c556739 API File has Versioned extension
API Improved support for versioned DataObject
API GridField extensions for versioned dataobjects
API De-couple File and ErrorPage
API File::handle_shortcode now respects canView()
API AssetControlExtension is now able to delete, publish, or protect files
API Upload now protects new assets by default
2016-02-23 13:46:28 +13:00
Damian Mooyman
f20ad434ce API Update TinyMCE to 4.x
API Allow HtmlEditorField to be individually configured
BUG Fix incorrect change detection
BUG Fix missing i18n files
2016-02-23 10:10:02 +13:00
vinnie watson
a66ecf3591 GridField export and print buttons updated to new style 2016-02-22 10:03:39 +13:00
Ben Manu
7e116aa908 Removing legacy TODO reference for data-urlviewfile on MediaForm once metadata dep is removed. 2016-02-19 14:33:20 +13:00
Damian Mooyman
56e92f5a32 [ss-2016-002] Ensure Gridfield actions respect CSRF 2016-02-18 17:28:54 +13:00
Damian Mooyman
230d017677 Merge remote-tracking branch 'origin/3'
# Conflicts:
#	admin/css/ie7.css.map
#	admin/css/screen.css
#	admin/css/screen.css.map
#	admin/font/icon-reference.html
#	admin/font/silverstripe.eot
#	admin/font/silverstripe.svg
#	admin/font/silverstripe.ttf
#	admin/font/silverstripe.woff
#	admin/scss/_forms.scss
#	admin/scss/_style.scss
2016-02-12 15:41:45 +13:00
Daniel Hensby
31a4e184f7 Merge pull request #5013 from Legin76/patch-2 2016-02-04 21:26:47 +00:00
Legin76
68433cc552 Update UploadField.php to allow configurable GridFieldPaginator
Changed $config->addComponent(new GridFieldPaginator(11)); to allow it to be configured from the config.yml
2016-02-04 17:23:32 +00:00
Damian Mooyman
6cebffd89b BUG Fix SSViewerTest not restoring old requirements
BUG Fix incorrect js path in UploadField.php
Restore changes missing from merge
2016-01-26 11:39:53 +13:00
David Craig
2140025c20 Implement RFC-7 JavaScript module loader
- Adds ES6 support via Babel
- Transforms existing JavaScript to UMD modules
- Adds module bundling via Browserify
- Existing JavaScript converted to UMD modules
- lib.js and leftandmain.js are bundled using browserify
- JavaScript minifying of bundles handed by gulp
2016-01-26 11:39:20 +13:00
Damian Mooyman
99de74d69e API Add isDisabledValue to SelectField
API Remove deprecated {comma} syntax for multi select string encoded values
API MemberDatetimeOptionsetField now has a fixed preview date
BUG fix inverted arguments in OptionSetField::getOptionClass
2016-01-21 15:40:19 +13:00
Damian Mooyman
bdb1a95758 API Cleanup and refactor of select fields
API Standardise Relation interface
2016-01-21 15:40:19 +13:00
Damian Mooyman
e6b877df27 Merge remote-tracking branch 'origin/3'
# Conflicts:
#	control/Director.php
#	control/HTTP.php
#	core/startup/ParameterConfirmationToken.php
#	docs/en/00_Getting_Started/01_Installation/05_Common_Problems.md
#	docs/en/00_Getting_Started/04_Directory_Structure.md
#	docs/en/00_Getting_Started/05_Coding_Conventions.md
#	docs/en/01_Tutorials/01_Building_A_Basic_Site.md
#	docs/en/01_Tutorials/02_Extending_A_Basic_Site.md
#	docs/en/01_Tutorials/03_Forms.md
#	docs/en/01_Tutorials/04_Site_Search.md
#	docs/en/01_Tutorials/05_Dataobject_Relationship_Management.md
#	docs/en/02_Developer_Guides/12_Search/01_Searchcontext.md
#	docs/en/02_Developer_Guides/13_i18n/index.md
#	docs/en/02_Developer_Guides/15_Customising_the_Admin_Interface/06_Javascript_Development.md
#	docs/en/03_Upgrading/index.md
#	docs/en/changelogs/index.md
#	docs/en/howto/customize-cms-menu.md
#	docs/en/howto/navigation-menu.md
#	docs/en/index.md
#	docs/en/installation/index.md
#	docs/en/installation/windows-manual-iis-6.md
#	docs/en/misc/contributing/code.md
#	docs/en/misc/contributing/issues.md
#	docs/en/misc/module-release-process.md
#	docs/en/reference/dataobject.md
#	docs/en/reference/execution-pipeline.md
#	docs/en/reference/grid-field.md
#	docs/en/reference/modeladmin.md
#	docs/en/reference/rssfeed.md
#	docs/en/reference/templates.md
#	docs/en/topics/commandline.md
#	docs/en/topics/debugging.md
#	docs/en/topics/email.md
#	docs/en/topics/forms.md
#	docs/en/topics/index.md
#	docs/en/topics/module-development.md
#	docs/en/topics/modules.md
#	docs/en/topics/page-type-templates.md
#	docs/en/topics/page-types.md
#	docs/en/topics/search.md
#	docs/en/topics/testing/index.md
#	docs/en/topics/testing/testing-guide-troubleshooting.md
#	docs/en/topics/theme-development.md
#	docs/en/tutorials/1-building-a-basic-site.md
#	docs/en/tutorials/2-extending-a-basic-site.md
#	docs/en/tutorials/3-forms.md
#	docs/en/tutorials/4-site-search.md
#	docs/en/tutorials/5-dataobject-relationship-management.md
#	docs/en/tutorials/building-a-basic-site.md
#	docs/en/tutorials/dataobject-relationship-management.md
#	docs/en/tutorials/extending-a-basic-site.md
#	docs/en/tutorials/forms.md
#	docs/en/tutorials/index.md
#	docs/en/tutorials/site-search.md
#	main.php
#	model/SQLQuery.php
#	security/ChangePasswordForm.php
#	security/MemberLoginForm.php
#	tests/control/ControllerTest.php
#	tests/core/startup/ParameterConfirmationTokenTest.php
#	tests/model/SQLQueryTest.php
#	tests/security/SecurityTest.php
#	tests/view/SSViewerTest.php
#	view/SSTemplateParser.php
#	view/SSTemplateParser.php.inc
#	view/SSViewer.php
2016-01-20 13:16:27 +13:00
Damian Mooyman
8e4db95f72 Fix merge regressions 2016-01-19 17:08:40 +13:00
Damian Mooyman
8c1cafd1a0 Merge remote-tracking branch 'origin/3.3' into 3
# Conflicts:
#	admin/scss/_forms.scss
#	admin/scss/_style.scss
#	admin/scss/_tree.scss
#	javascript/TreeDropdownField.js
2016-01-19 17:08:26 +13:00
Damian Mooyman
5d240feaec Merge remote-tracking branch 'origin/3.2' into 3.3 2016-01-19 15:08:24 +13:00
Damian Mooyman
46cbe809ac Merge remote-tracking branch 'origin/3.1' into 3.2
# Conflicts:
#	docs/en/02_Developer_Guides/09_Security/04_Secure_Coding.md
#	docs/en/02_Developer_Guides/14_Files/01_Image.md
#	docs/en/02_Developer_Guides/15_Customising_the_Admin_Interface/How_Tos/Customise_CMS_Menu.md
#	docs/en/03_Upgrading/index.md
#	docs/en/05_Contributing/01_Code.md
#	forms/TreeMultiselectField.php
#	security/Permission.php
2016-01-19 14:00:19 +13:00
Damian Mooyman
12612b4200 Merge pull request #4914 from torleif/patch-2
FIX OptionsetField returns valid HTML #4901
2016-01-13 13:06:51 +13:00
Daniel Hensby
2dd8d5e518 Fixing anchor selection 2016-01-12 17:35:06 +00:00
Torleif West
a7110bef70 FIX OptionsetField uses aria-required 2016-01-12 14:52:36 +13:00
torleif
288c8a8b27 FIX OptionsetField returns valid HTML #4901 2016-01-12 11:38:03 +13:00
Sam Minnee
4aa50534d5 FIX: Fixes needed to adapt to whitespace changes.
API: Whitespace trimmed from custom form field templates

The introduction of trailing newlines on all template files introduced
some changes that needed to be made.

Notably, whitespace has been trimmed from rendered form field templates.
This is the minimal impact to SilverStripe developers, as it preserves
the behaviour of the default field types, but I’ve still noted as a
change.
2016-01-07 14:17:57 +13:00
Sam Minnee
3ee8f505b7 MINORE: Remove training whitespace.
The main benefit of this is so that authors who make use of
.editorconfig don't end up with whitespace changes in their PRs.

Spaces vs. tabs has been left alone, although that could do with a
tidy-up in SS4 after the switch to PSR-1/2.

The command used was this:

for match in '*.ss' '*.css' '*.scss' '*.html' '*.yml' '*.php' '*.js' '*.csv' '*.inc' '*.php5'; do
	find . -path ./thirdparty -not -prune -o -path ./admin/thirdparty -not -prune -o -type f -name "$match" -exec sed -E -i '' 's/[[:space:]]+$//' {} \+
	find . -path ./thirdparty -not -prune -o -path ./admin/thirdparty -not -prune -o -type f -name "$match" | xargs perl -pi -e 's/ +$//'
done
2016-01-07 10:15:54 +13:00
Peter Thaleikis
45dc510da7 fixing typo 2016-01-06 00:33:22 +13:00
Florian Thoma
e94c0fa221 FIX extraClass() method to match parent method 2015-12-23 21:06:00 +11:00
Damian Mooyman
b38f316a80 Merge pull request #4851 from SilbinaryWolf/remove-validation-from-lookupfield
BUG Resolve issue with readonly LookupField failing validation
2015-12-22 16:28:01 +13:00
Damian Mooyman
4e3d6f9118 Fix merge regressions from 3.2 -> 3 2015-12-22 14:35:05 +13:00
Damian Mooyman
48a30909f3 Merge remote-tracking branch 'origin/3.2' into 3
# Conflicts:
#	admin/javascript/LeftAndMain.BatchActions.js
#	css/UploadField.css
#	forms/HtmlEditorField.php
2015-12-22 14:07:52 +13:00
Russell
4d047e5cb7 Fix path to /thirdparty/jquery-ui-themes/smoothness/jquery-ui.css 2015-12-22 10:45:01 +13:00
Jake Bentvelzen
0bf55cff39 Stubbed saveInto for LookupField so that data can't be saved on a form accidentally 2015-12-16 09:42:14 +11:00
Daniel Hensby
e443a10a5e Fixing deselect failing to change field title 2015-12-15 11:31:55 +00:00
Jake Bentvelzen
65d7398c63 Removed validation from LookupField as it's readonly and just gets in the way of saving data in certain cases 2015-12-15 18:00:57 +11:00
Loz Calver
d6d3aa3554 Remove duplicate code 2015-12-14 16:50:34 +00:00
Loz Calver
d265c9b733 FIX: Allow omitting a value for OptionsetField submissions (fixes #4824) 2015-12-14 16:50:22 +00:00
Loz Calver
9467ab9a7e NEW: Implement unshift() in field list classes (closes #4834) 2015-12-14 16:18:57 +00:00
Marco Pivetta
ffda95334f Dead code removal (constructor type-hints are sufficient)
Thanks to @lcobucci for making me notice this.
2015-12-11 01:30:07 +01:00
Damian Mooyman
2b1e5ee071 API Enable DataList::sort to support composite field names (similar to filter) 2015-12-01 09:35:33 +13:00
Marijn Kampf
006717a3cc Fix Fatal error on invalid image
If user has uploaded an invalid image the original code would crash when called from template
2015-11-25 12:17:50 +00:00
Christopher Darling
e9b833f5f0 FIX: ConfirmedPassword field correctly reports mismatching passwords
added testFormValidation to prove #4780
2015-11-20 15:56:27 +00:00
Damian Mooyman
83ede291bd Merge pull request #4779 from kinglozzer/pulls/fieldgroup-composite-validation
FIX: Hidden errors for composite fields nested inside FieldGroups (fixes #4773)
2015-11-19 14:04:41 +13:00
Daniel Hensby
f8cd876217 Fixing regression from #4733 2015-11-18 14:16:25 +00:00
Loz Calver
68d99be24b FIX: Hidden errors for composite fields nested inside FieldGroups (fixes #4773) 2015-11-17 16:34:17 +00:00
Christopher Pitt
b8975721d3 Preventing multiple states added to single config 2015-11-17 12:53:04 +13:00
Damian Mooyman
fd6ae72e1d Merge remote-tracking branch 'origin/3.2.1' into 3.2 2015-11-16 16:39:15 +13:00
Hamish Friedlander
b61d6dcd57 [ss-2015-027]: FIX HtmlEditorField_Toolbar#viewfile not whitelisting URLs 2015-11-13 15:20:09 +13:00
Damian Mooyman
fea1158d19 BUG Fix print button only displaying first page 2015-11-12 14:59:08 +13:00
Daniel Hensby
234e5a8a59 Merge pull request #4733 from feejin/htmleditorfield-anchor-improvements
Check for id attributes for anchor targets and prevent partial matches
2015-11-11 14:52:32 +00:00
Damian Mooyman
245e0aae2f [ss-2015-026]: BUG Fix FormField error messages not being encoded safely 2015-11-11 17:50:02 +13:00
Damian Mooyman
bc1b2893ac [ss-2015-026]: BUG Fix FormField error messages not being encoded safely 2015-11-11 16:56:19 +13:00
muskie9
603caccb90 ENHANCEMENT CurrencyField to use Currency.currency_symbol
fixes #4035

I have limited experience with regex, so I hope I did it correctly. I was able to save/save & publish with the curent regex and the values look good.
2015-11-09 19:38:51 -06:00
Damian Mooyman
414ea3de9e BUG prevent UploadField edit form generation for Folders 2015-11-09 16:39:33 +13:00
Damian Mooyman
1e1a7a345c Merge remote-tracking branch 'origin/3'
Conflicts:
	control/Director.php
	filesystem/File.php
	filesystem/GD.php
	filesystem/ImagickBackend.php
	forms/HtmlEditorField.php
	javascript/UploadField_uploadtemplate.js
	model/Image.php
	model/Image_Backend.php
	model/fieldtypes/Enum.php
	templates/AssetUploadField.ss
	tests/model/ImageTest.php
	tests/search/FulltextFilterTest.php
2015-11-03 14:23:16 +13:00
Damian Mooyman
c4dc10b255 Merge remote-tracking branch 'origin/3.2' into 3
Conflicts:
	forms/DropdownField.php
	tests/model/ImageTest.php
2015-11-03 13:06:39 +13:00
Colin Richardson
8dc9282adf check for id attributes for anchor targets and prevent partial matches e.g. data-name='foo' 2015-11-02 10:38:54 +00:00
madmatt
275ecfd8a9 BUGFIX: Use Object->hasMethod() instead of method_exists()
This fixes an issue when you pass a `PaginatedList` back from `ModelAdmin::getList()`
2015-11-01 09:10:29 +13:00
Ingo Schommer
1fb6bbb422 Merge pull request #4701 from scott1702/update-upload-button
Update asset admin toolbar
2015-10-30 09:14:41 +13:00
scott1702
9f9d0089df Send user to new area when inserting url 2015-10-29 11:37:59 +13:00
Damian Mooyman
db16248b9a BUG Fix broken InlineFormAction 2015-10-29 10:48:49 +13:00
Ingo Schommer
b5c10fd27d Revert FormField->extraClass() inclusion of disabled/readonly
Introduced in d1ea74e40d, but too high risk in terms of causing
CSS or JS side effects when implemented on a FormField level.
2015-10-27 08:15:27 +13:00
scott1702
1f64631bfc Update asset admin toolbar 2015-10-23 17:39:42 +13:00
Damian Mooyman
d1ea74e40d API Implement AssetField to edit DBFile fields 2015-10-23 16:57:44 +13:00
Cam Findlay
c3641587a5 FIX only use sethasemptydefault if exists.
Backport of #4672 with a slight rewrite incase of subclasses of the field.
2015-10-20 12:39:04 +13:00
Damian Mooyman
d884c859d1 BUG Fix file link tracking for new asset abstraction 2015-10-15 12:15:00 +13:00
Damian Mooyman
be239896d3 API Refactor of File / Folder to use DBFile
API Remove filesystem sync
API to handle file manipulations
2015-10-13 11:57:39 +13:00
JorisDebonnet
f6a1e5ec30 Bugfix for DropdownField->castedCopy
The Newsletter module crashed on it when viewing a sent Newsletter.
2015-10-08 19:02:47 +02:00
Patrick Nelson
a71d99cf84 FIX for #4663 ensuring return values from TabSet are retained from parent. Removing useless override. Cleaning up documentation in TabSet and return types. 2015-10-07 17:03:51 -04:00
Patrick Nelson
12c423909f FIX (partial) for #3181 where non-submit buttons are being activated on "enter" key press (relates to CMS issue at https://github.com/silverstripe/silverstripe-cms/issues/1288). 2015-10-06 15:03:49 -04:00
scott1702
23baa288ba Sticky footer on insert media/link elements 2015-10-01 15:35:56 +13:00
Loz Calver
cb55a0a621 FIX: GridFieldSortableHeader incorrectly reporting fields as sortable 2015-09-30 16:25:17 +01:00
Damian Mooyman
1f632a10c9 BUG Replace direct reference to $_REQUEST['url'] with request object getter 2015-09-29 12:10:39 +13:00
scott1702
3f85c57013 Move 'upload new file' section to main files area
Optimise and fix drag drop on upload fields

Combine 3 tabs from the 'insert media' dialog box into 1
2015-09-28 12:02:33 +13:00
Damian Mooyman
10dece653f API Consolidate DataObject db methods
BUG Fix namespace and getField on composite fields
2015-09-22 10:38:12 +12:00
Damian Mooyman
9872fbef4d API Refactor CompositeDBField into an abstract class
API Refactor ClassName into DBClassName
API Update PolymorphicForeignKey to use new CompositeDBField and DBClassName

CompositeDBField is now an interface to nested fields on an underlying dataobject, allowing field manipulation to be performed at the field and dataobject level without having to synchronise them manually.
2015-09-22 10:28:07 +12:00
Damian Mooyman
b552a7370f Merge remote-tracking branch 'origin/3'
Conflicts:
	tests/model/ImageTest.php
2015-09-09 15:44:47 +12:00
Damian Mooyman
f10785350e Merge remote-tracking branch 'origin/3.2' into 3
Conflicts:
	docs/en/02_Developer_Guides/02_Controllers/01_Introduction.md
2015-09-09 14:50:47 +12:00
Damian Mooyman
309ac0d196 Merge remote-tracking branch 'origin/3.1' into 3.2
Conflicts:
	.travis.yml
	admin/code/CMSProfileController.php
	admin/tests/LeftAndMainTest.php
	control/HTTP.php
	security/Permission.php
	tests/forms/FormTest.php
	tests/model/ArrayListTest.php
	tests/security/PermissionTest.php
2015-09-09 14:35:29 +12:00
Jake Bentvelzen
d766f9fd13 Modified GridField in 'HtmlEditorField_Toolbar' class to allow custom classes. 2015-09-01 10:38:58 +10:00
Damian Mooyman
e86b45bf5d BUG Remove html5 number field due to insufficient localisation support 2015-09-01 12:23:35 +12:00
Damian Mooyman
dc4c40f642 Merge pull request #4507 from JorisDebonnet/resampled-images-in-folders
Save resampled images into a folder structure indicating transformations
2015-09-01 11:16:23 +12:00
JorisDebonnet
ea05526e9d Save resampled images into a folder structure indicating transformations 2015-09-01 00:40:27 +02:00
Sam Minnée
f4b7cd3f68 Merge pull request #4500 from stevie-mayhew/pulls/get-response
FEATURE: implement getter and setter usage for response
2015-08-29 15:35:55 +12:00
Stevie Mayhew
1b57e0ca5b FEATURE: implement getter and setter usage for response 2015-08-29 10:24:06 +12:00
Daniel Hensby
8015919932 Be defensive with token availability 2015-08-27 17:58:43 +01:00
Daniel Hensby
899eb0b235 FIX Use complete fieldlist for extracting data 2015-08-27 17:58:19 +01:00
Damian Mooyman
1686c83826 Revert #3425 #3396 to restore deprecated functionality
Fixes #4514
2015-08-24 11:26:25 +12:00