Commit Graph

564 Commits

Author SHA1 Message Date
Sam Minnee
71dad5f685 FIX: Append any fields that don’t match name in insertBefore/insertAfter
Previous behaviour was to return false, which has been described as
a confusing bug on https://github.com/silverstripe/silverstripe-framework/issues/1397
where the issue was identified.
2018-10-02 10:39:48 +13:00
Robbie Averill
bfe2a7b7e6 Update testSearchFieldSchema to expect namespaced search fields 2018-10-01 12:44:19 +02:00
Harsh Chokshi
60dd5f288b Implement __isset for ViewableData_Customised
Resolves #8302.
2018-10-01 09:40:12 +13:00
Dan Hensby
3584598d7a
Minor improvements 2018-09-29 22:51:26 +01:00
Dan Hensby
b0e0566c93
Formatting 2018-09-29 22:51:26 +01:00
Dan Hensby
5a3cc9503b
Formatting 2018-09-29 22:51:26 +01:00
Dan Hensby
2ef63ddbc1
Remove unused function args 2018-09-29 22:51:26 +01:00
Dan Hensby
7a18cd98e0
Improve assertion type 2018-09-29 22:51:26 +01:00
Dan Hensby
90e74a608e
Throwing and catcing an error in tests is mad 2018-09-29 22:51:26 +01:00
Dan Hensby
3c532cea0c
Minor cleanup of DirectorTest 2018-09-29 22:51:26 +01:00
Dan Hensby
3a007d52e6
Code formatting 2018-09-29 22:51:18 +01:00
Robbie Averill
231d6d9a9f FIX New members now receive the configured default locale, not the current locale 2018-09-28 16:25:10 +02:00
Robbie Averill
d18b8eb9fb Add more tests for descending sort orders 2018-09-28 15:42:45 +02:00
Robbie Averill
4aa7fb70ee Add tests that show that joinClass default_sort is not used and order is honoured 2018-09-28 15:38:37 +02:00
Robbie Averill
f842ee2eec Update deprecation PHPDocs to be PSR-5 compliant
See: https://github.com/php-fig/fig-standards/blob/master/proposed/phpdoc-tags.md#55-deprecated
2018-09-28 10:49:14 +02:00
Robbie Averill
0c7ced1513 Refactor sorting tests to use a dataprovider 2018-09-27 17:18:19 +02:00
Robbie Averill
c7d522ff6d Add tests for sorting HasManyList 2018-09-27 17:09:24 +02:00
Robbie Averill
3321c6b39d Add tests for sorting many many through list without a table alias 2018-09-27 14:34:37 +02:00
Dan Hensby
b3d2d4c1b1
Remove redundant code 2018-09-26 10:11:28 +01:00
Dan Hensby
db43d57618
Remove commented out test 2018-09-26 10:11:28 +01:00
Dan Hensby
fe5b431200
Use Member::actAs rather than setting and unsetting member 2018-09-26 10:11:20 +01:00
Dan Hensby
6b618b44c9
Remove regex in favour of simple assertContains 2018-09-26 00:36:58 +01:00
Dan Hensby
cb361e8caf
Remove unused code from ControllerTest 2018-09-26 00:30:20 +01:00
Dan Hensby
15bf13daa9
Dont use willReturn assertions to assert argument types 2018-09-26 00:21:37 +01:00
Dan Hensby
7d15d0af70
Refactor email validation into provider based test 2018-09-25 23:15:18 +01:00
Sam Minnée
5b7a84141b NEW: Add Hierarchy::prepopulate_numchildren_cache() (#8380)
* NEW: Add Hierarchy::prepopulate_numchildren_cache()
API: Hierarchy::stageChildren() customisations must be applied to the base class and not include record-specific behaviour.

Adds the ability to prepopulate the cache for Hierarchy::numChildren()
in a batch.

Note that this optimisation means that stageChildren() is not called on
each record in order to calculate numChildren(). This means that the
structure of the stageChildren() query must be the same for all records
and the behaviour cannot be customised only for a subclass of the base
data class. For example, apply your customisations to SiteTree and not
a subclass.

This is an useful part of optimising the query count on tree generation.
See https://github.com/silverstripe/silverstripe-framework/issues/8379

* NEW: Add Hierarchy::prepopulateTreeDataCache()

This provides a more extensible way of preopulating caches for optimised
tree generation.

Fixes https://github.com/silverstripe/silverstripe-framework/issues/8391
2018-09-25 12:25:23 +12:00
Robbie Averill
d11911d4dd
Merge pull request #8394 from littlegiant/pulls/4.2/http-status-codes
BUG Prevent error on valid response status codes
2018-09-21 13:19:29 +02:00
Damian Mooyman
1d5ecd342e
BUG Prevent error on valid response status codes 2018-09-21 14:54:26 +12:00
Luke Edwards
3fc49dd4ce Lint fixes and allow a few other components by default 2018-09-20 13:32:52 +12:00
Maxime Rainville
cc22024e9a ADD New search component for GridFields (#1777) 2018-09-04 11:35:17 +12:00
Simon Gow
4c3a068859 Issue 3357 - Add GridField Readonly Transformation
GridField doesn't have a valid readonly state if it's value is set to an Object
without `forTemplate()`. The default behaviour is to render a ReadonlyField,
but given GridField is a complex type this isn't suitable.

This bugfix provides a transformation method to render only components that are
whitelisted to provide a readonly state.

@see #3357 - https://github.com/silverstripe/silverstripe-framework/issues/3357
2018-08-29 14:47:06 +12:00
Robbie Averill
83e461abbf Merge branch '4.2' into 4 2018-08-27 16:15:57 +12:00
Luke Edwards
6164d01d65 FIX GridField delete button to offer archive action if possible (#8325)
* FIX GridField delete button to offer archive action if possible

* Refactor archive action to versioned module

* Fix GridFieldDeleteAction test
2018-08-24 13:13:32 +12:00
Robbie Averill
dbab696690 FIX Message when changing password with invalid token now contains correct links to login
The Security controller should be used to return these links rather than the
ChangePasswordHandler
2018-08-20 22:30:12 +12:00
Daniel Hensby
d9154bffbf
FIX text/json is not a valid mimetype 2018-08-15 12:10:39 +01:00
Daniel Hensby
d0598c02c5
Merge branch '4.2' into 4 2018-07-30 11:07:15 +01:00
Daniel Hensby
ec5640cbd9
Merge tag '4.2.0' into 4.2
Release 4.2.0
2018-07-30 11:04:57 +01:00
Ingo Schommer
d12c2fe631
Properly deprecate HTTP.cache_control 2018-07-23 19:09:11 +01:00
Ingo Schommer
d426ecbb89
Add $maxAge arg for caching API
See https://github.com/silverstripe/silverstripe-framework/issues/8272
2018-07-23 19:09:10 +01:00
Daniel Hensby
cc0320b2a7
Merge branch '4.2' into 4 2018-07-23 17:42:43 +01:00
Daniel Hensby
ccbbcd45a2
FIX Fixed bug in config merging priorities so that config values set by extensions are now least important instead of most important 2018-07-23 14:15:24 +01:00
Daniel Hensby
6e1c7c2781
FIX remove personal information from password reset confirmation screen 2018-07-23 14:13:52 +01:00
Maxime Rainville
c77042aa8b
Fix linting. 2018-07-23 14:12:44 +01:00
Maxime Rainville
7fda52b2cd
Add a MERGE_AS_SUBMITTED_VALUE flag for Form::loadDataFrom 2018-07-23 14:12:43 +01:00
Maxime Rainville
3fa2c056d7
FIX Don't reload form session data using FormField::setSubmittedValue (#8056) 2018-07-23 14:12:43 +01:00
Ingo Schommer
73026292bf
Test coverage for session data change 2018-07-23 14:09:43 +01:00
Daniel Hensby
e37b3b95f4
FIX updateValidatePassword calls need to be masked from backtraces 2018-07-23 14:08:26 +01:00
Daniel Hensby
540c9aba69
TEST Add tests for (im)mutablity of states 2018-07-23 14:07:11 +01:00
Damian Mooyman
8ea3bb36a0
Maybe fix it? 2018-07-23 14:01:21 +01:00
Daniel Hensby
b984959170
Merge branch '4.1' into 4.2 2018-07-23 13:30:49 +01:00
Ingo Schommer
c541283093 Test coverage for session data change 2018-07-20 15:13:26 +12:00
Daniel Hensby
921b98112e
Merge pull request #8262 from open-sausages/pulls/4/falsifying-tab-evidence
MINOR removeField(s)FromTab no longer creates a tab if it doesn't exist
2018-07-16 17:26:41 +01:00
Loz Calver
b317bf163c
Merge pull request #8213 from creative-commoners/pulls/4.2/falsy-forms
FIX FormField::Link works when no form is currently set
2018-07-16 13:53:58 +01:00
Robbie Averill
b93e94c0c3
FIX FormField::Link now throws a LogicException if no form is set yet 2018-07-16 13:02:58 +01:00
Daniel Hensby
1a634f5ba6
Merge pull request #8244 from altwohill/column-not-distinct
Make column query not distinct
2018-07-16 13:01:32 +01:00
Al Twohill
3292a8b773
NEW Add columnUnique API SS_List classes. 2018-07-16 12:16:17 +01:00
Al Twohill
91068c23b5
FIX Make column query not distinct
When selecting a column, it doesn't  make sense to have it distinct.

As an alternative, the API could be changed to give the end user the option
(eg `->column($field, $distinct = false)`)
However if we did that, we would need to make sure we do something
similar with `SilverStripe\ORM\UnsavedRelationList` to ensure consistency.
2018-07-16 11:38:41 +01:00
Damian Mooyman
c6952b46c4
Merge pull request #8245 from dhensby/pulls/4.2/http-cache-fixes
HTTPCacheControlMiddleware fixes
2018-07-16 13:13:12 +12:00
Luke Edwards
c8b338b0a3 Add findTab test 2018-07-16 11:59:08 +12:00
Daniel Hensby
8703839eb1
FIX updateValidatePassword calls need to be masked from backtraces 2018-07-15 01:06:45 +01:00
Daniel Hensby
ac5c3416a4
Merge branch '4.2' into 4 2018-07-13 17:06:51 +01:00
Daniel Hensby
bd2abc7a12
Merge branch '4.1' into 4.2 2018-07-13 16:44:23 +01:00
Daniel Hensby
ec9281ee02
Merge branch '4.0' into 4.1 2018-07-13 16:42:00 +01:00
Daniel Hensby
4acec33562
FIX Fixed bug in config merging priorities so that config values set by extensions are now least important instead of most important 2018-07-12 00:55:39 +01:00
Daniel Hensby
28f2ceac6f
TEST Add tests for (im)mutablity of states 2018-07-10 16:58:08 +01:00
Harsh Chokshi
6af736a9e1 Change DBCurrency scaffolded form field to CurrencyField (fixes #8246)
Add test ensuring DBCurrency scaffolds CurrencyField
2018-07-09 10:57:01 +12:00
Daniel Hensby
560fe9820a FIX remove personal information from password reset confirmation screen 2018-07-05 14:19:15 +12:00
Robbie Averill
a39a221c4c Merge branch '4.2' into 4 2018-06-25 13:45:03 +12:00
Damian Mooyman
6da72d686f Maybe fix it? 2018-06-20 14:46:50 +12:00
Robbie Averill
7d90a14f37 NEW Shift Embeddable and EmbedResource from asset-admin, lazy load Embed to allow injected dependencies (#8194) 2018-06-20 11:40:28 +12:00
Robbie Averill
12cc2c68a5
Merge pull request #8023 from silverstripe-terraformers/feature/lookup_field_set_value_fix
LookupField value handling corrected
2018-06-19 21:37:36 +12:00
Damian Mooyman
cfc3b851e7
Merge remote-tracking branch 'origin/4.1' into 4.2
# Conflicts:
#	lang/sv.yml
2018-06-19 17:20:25 +12:00
Maxime Rainville
3f80e2dc67 FIX Don't reload form session data using FormField::setSubmittedValue… (#8184) 2018-06-19 11:27:09 +12:00
Robbie Averill
5fa5abf295 Merge branch '4.1' into 4
# Conflicts:
  #	src/Forms/DateField.php
2018-06-15 11:52:07 +12:00
Damian Mooyman
b636587945
Respect semver and add tests 2018-06-15 11:04:12 +12:00
Damian Mooyman
c414388220
FIX DatetimeFieldTest 2018-06-14 18:14:12 +12:00
Ingo Schommer
1c5876acf0
Merge pull request #8179 from open-sausages/pulls/4/safer-test-clear
BUG Make regression in #7839 safer
2018-06-14 17:28:13 +12:00
Damian Mooyman
d52c4dd602
BUG Make regression in #7839 safer 2018-06-14 16:45:09 +12:00
Damian Mooyman
c271a43904
Linting fixes 2018-06-14 12:19:55 +12:00
Damian Mooyman
163f1523e9
Add upgrade rule for HTTPCacheControl 2018-06-14 11:55:05 +12:00
Damian Mooyman
59ba208df0
Fix HTTPTest 2018-06-14 11:46:28 +12:00
Damian Mooyman
687d0a6af1
Refactor everything out of HTTP and into separate middlewares 2018-06-13 17:56:47 +12:00
Damian Mooyman
6f32762268
Fix unit tests 2018-06-13 14:09:31 +12:00
Damian Mooyman
aa1ba0ef90
Fix inverted condition
Remove unnecessary yml block
Deprecate HTTP::set_cache_age()
2018-06-13 13:56:47 +12:00
Daniel Hensby
e76cf93514 Migrate tests 2018-06-13 11:33:46 +12:00
Damian Mooyman
6c985c4e5f
Merge remote-tracking branch 'origin/4.1' into 4 2018-06-13 11:25:20 +12:00
Daniel Hensby
ce58890baf
Merge branch '4.0' into 4.1 2018-06-11 09:27:42 +01:00
Robbie Averill
27e24a4728
Merge pull request #8142 from open-sausages/pulls/4.0/fix-injector-empty
BUG Safely handle empty injector factory responses
2018-06-11 15:20:24 +12:00
Damian Mooyman
77a45c0dbc
Merge remote-tracking branch 'origin/4.1' into 4
# Conflicts:
#	src/Forms/HTMLEditor/HTMLEditorSanitiser.php
#	src/ORM/DataObjectSchema.php
#	src/ORM/Queries/SQLSelect.php
#	src/View/Parsers/ShortcodeParser.php
2018-06-11 10:19:04 +12:00
Damian Mooyman
546c6c3e22
Merge pull request #8125 from open-sausages/pulls/4/date-field-tweaks
Remove legacy logic from DateField_Disabled
2018-06-11 09:23:33 +12:00
Daniel Hensby
e260319823
Merge branch '4.0' into 4.1 2018-06-08 23:05:24 +01:00
Daniel Hensby
cfe93b7f23
Merge branch '3.6' into 4.0 2018-06-08 14:41:04 +01:00
Daniel Hensby
1d6d601050
Use chaining syntax for setting up middleware 2018-06-08 14:00:59 +01:00
Maxime Rainville
582c69d32f
BUG Fix issue with Disabled DateField always display (not set). 2018-06-08 13:51:22 +01:00
Ingo Schommer
48304fd6f0
Merge pull request #8102 from creative-commoners/pulls/4.1/response-assertion
Add test assertion for response instance
2018-06-08 14:08:25 +12:00
Damian Mooyman
e37e3e1746
BUG Fix test that relies on implicit ID order breaking postgres 2018-06-08 11:23:24 +12:00
Aaron Carlino
31ad3cdaab
BUGFIX: Allow buttons to opt out of display (#8113)
* Allow buttons to opt out of display

* Linting

* Remove redundant function call

* Add test for group delete action

* Add menu group check and test for delete action

* Fix linting
2018-06-06 21:14:29 +12:00
Damian Mooyman
c070e989c4
BUG Safely handle empty injector factory responses
Fixes issue with ImageBackendFactory returning null and breaking injector
2018-06-06 16:45:16 +12:00
Damian Mooyman
0aa13da0d9
BUG Backport bugfix for belongs_many_many with many_many through.
Partial backport of #7928
Fixes #8131
2018-06-06 09:43:04 +12:00
Daniel Hensby
0bec6e07dc
Merge pull request #8111 from open-sausages/pulls/4/7.2-is-just-out-of-each
BUGFIX: Refactor difflib to not use each()
2018-06-04 12:47:59 +01:00