Commit Graph

1482 Commits

Author SHA1 Message Date
Guy Marriott
b4c8f699eb
FIX Provide alternatives to session for storing GridField_FormAction state 2018-11-30 15:40:45 +13:00
Sam Minnee
0c17ffc944 FIX: Manifest should ignore vendor folders within packages contained in vendor
Without this change vendor/silverstripe/framework/vendor/silverstripe/config
will be pick up by the manifest, which is inappropriate.

Although this doesn’t happen often, it can occur if you have run
“composer install” within vendor/silverstripe/framework, which can be
done either accidentally or (in my case) as part of running the
framework tests isolated from the rest of your project (which is closer
to the execution model on Travis)

Note that the presence of the ‘nestedvendor.txt’ file tests that this
works without any explicit changes to the PHP of the tests, since it’s
merely confirming that such a file is *not* picked up.
2018-11-30 13:52:25 +13:00
Loz Calver
3f8551df41
Merge pull request #8462 from sminnee/nondestructive-enum
FIX: Make all enums non-destructive, not just ClassName
2018-11-28 16:42:12 +01:00
Loz Calver
441d079647
Merge pull request #8637 from creative-commoners/pulls/4.4/falsy-detail-component
FIX getComponentByType can return null - prevent null pointer errors
2018-11-26 18:28:26 +01:00
Robbie Averill
f22a4b980b FIX getComponentByType can return null - prevent null pointer errors 2018-11-26 16:01:46 +01:00
Robbie Averill
efa427fc45 FIX Remove redundant "rightGroup" logic and increase getRightGroupField to protected 2018-11-26 12:42:47 +01:00
Robbie Averill
1f1c344272 Merge branch '4.3' into 4
# Conflicts:
 #	tests/php/Forms/ConfirmedPasswordFieldTest.php
2018-11-26 12:15:17 +01:00
Robbie Averill
41dc9229bf FIX Reverting ExtensionTestState and Extensible extra methods modifications to prevent PHP 5.6 segfault (#8581)
* API Revert addition of Extensible::flush_extra_methods_cache() and change to ExtensionTestState

This reverts the changes from #8465 and #8505 that relate to ExtensionTestState and the
tracking of extra methods between unit tests. The existing test from #8465 testing
overloaded Extensions after extra_methods are populated has been updated to show that you
must re-add the extension to flush the extra_methods cache if you need this behaviour.

* Revert change to InjectorTest::testExtendedExtensions

* Revert "Add failing test to show that overloaded extensions are broken in Extensible"

This reverts commit 55e79ffdfd.

* DOCS Add docs for extending extensions, and upgrade guide note to 4.3 to avoid using PHP config to do so
2018-11-26 12:00:02 +13:00
Andre Kiste
1d9e40ba26 Use new plus icon (#8619)
* Use new plus icon and refactor

* MINOR: Add ability to customise the visibility of the `Previous`, `Next` and `Add` buttons at a `GridField` level

* - Merge `showPrevious` and `showNext` to `showPagination` for grid fields
- Update documentation
- Improve performance for next/previous buttons by not fetching all list records
- Refactoring

* Refactor to fail gracefully on GridFieldPaginator

* Fix merge
2018-11-23 12:40:18 +13:00
Serge Latyntcev
9ce6d91b76 FIX / TreeMultiselectField::objectForKey handles list of IDs correctly 2018-11-22 12:11:18 +13:00
Maxime Rainville
d74af1c17e FIX Explicity mark nodes when searching nodes in TreeDropdownField #8621 2018-11-21 11:43:21 +13:00
Andre Kiste
cc712892a9 NEW Port betterbuttons to framework (#8569)
* MINOR: Add `Previous`, `Next` and `Create New` actions in edit form

If the form is opened via a grid field, the filters will be retained so the previous/next record opened will be correct

* MINOR: Add ability to customise the visibility of the `Previous`, `Next` and `Add` buttons at a `GridField` level

* Fix invalid action when pressing the `New` button in an edit form unless `betterbuttons` module was installed

* - Merge `showPrevious` and `showNext` to `showPagination` for grid fields
- Update documentation
- Improve performance for next/previous buttons by not fetching all list records
- Refactoring

* Refactor to fail gracefully on GridFieldPaginator
2018-11-19 11:06:47 +13:00
Robbie Averill
3b1e91eb59 Merge branch '4.2' into 4.3 2018-11-15 13:41:23 +02:00
Robbie Averill
ef0f9dff8a Merge branch '4.1' into 4.2 2018-11-15 13:41:00 +02:00
Robbie Averill
c6e3a398c7 Merge branch '4.0' into 4.1 2018-11-15 13:40:08 +02:00
Loz Calver
b5bae137bd FIX: Redirect loop with multiple confirmation tokens present (fixes #8607) 2018-11-15 10:59:42 +00:00
Robbie Averill
580214cc30 API Add PHP deprecation notices to setLogger and getLogger 2018-11-13 11:12:06 +02:00
Robbie Averill
8854f053c8 Fix rebase conflicts 2018-11-13 11:09:33 +02:00
Robbie Averill
a8853504b4 API API MonologErrorHandler::setLogger is deprecated, use MonologErrorHandler::pushLogger instead 2018-11-13 11:08:27 +02:00
Robbie Averill
0a672372ff Update typos in PHPDocs and comments 2018-11-13 10:59:37 +02:00
Robbie Averill
d37551de34 NEW Setters in DebugViewFreindlyErrorFormatter are now chainable 2018-11-13 10:59:37 +02:00
Serge Latyntcev
15aaf9db9f Fix a code style typo 2018-11-13 10:20:49 +13:00
Guy Marriott
b2dd22fb50
Merge pull request #8506 from creative-commoners/pulls/4.3/all-the-unit-tests
NEW Adding a stack more unit tests for logging and some form fields
2018-11-11 10:31:24 +13:00
Sam Minnee
bd5a815909 FIX: Make all enums non-destructive, not just ClassName
This change also renders a portion of DBSchemaManager irrelevant, that
destructively “fixes” old values. This is in keeping with the
non-destructive principle of dev/build, and some suggestions to move
away from enum fields altogether.

Fixes https://github.com/silverstripe/silverstripe-framework/issues/1387
2018-11-10 12:10:25 +13:00
Robbie Averill
0f2eebe5d4 NEW Change to variadic calls in ListDecorator and add unit tests 2018-11-09 13:59:14 +02:00
Loz Calver
bbb208e1dd
Merge pull request #8499 from sminnee/fix-1489
FIX: CheckboxSetField can now save into DBMultiEnum
2018-11-09 10:40:55 +01:00
Robbie Averill
24d6527845 Merge branch '4.3' into 4 2018-11-09 11:39:27 +02:00
Robbie Averill
10f502f0c7 Merge branch '4.2' into 4.3 2018-11-09 11:39:05 +02:00
Robbie Averill
5b7723df7f Merge branch '4.1' into 4.2
# Conflicts:
 #	lang/fi.yml
 #	lang/nl.yml
2018-11-09 11:38:04 +02:00
Robbie Averill
df4d2bd838 Merge branch '4.0' into 4.1
# Conflicts:
 #	lang/da.yml
 #	lang/eo.yml
 #	lang/fi.yml
 #	lang/it.yml
 #	lang/nl.yml
 #	lang/sv.yml
2018-11-09 11:36:34 +02:00
Sam Minnee
0cc39af382 DOC: Added documentation for strict type changes 2018-11-09 11:08:36 +13:00
Sam Minnee
2615399535 FIX: Use PDO’s built-in transaction support in MySQLDatabase. 2018-11-09 10:31:19 +13:00
Sam Minnee
0111b98b18 FIX: Ensure that types are preserved fetching from database
This ensures that numeric fields appear in PHP as int/float values
rather than strings, which allows the development of more type-safe PHP
code.

This doesn’t work on the legacy mysql driver and this will now throw
a notice-level error. It requires mysqlnd.
2018-11-09 10:31:19 +13:00
Serge Latyntcev
4b4fbabed5 FIX TreeMultiselectField passes value 'unchanged' as null to ORM for 'ID' column key 2018-11-08 15:41:46 +13:00
Robbie Averill
e7041cdfeb
Merge pull request #8584 from wernerkrauss/cleanup-convert
Cleanup Convert
2018-11-07 21:51:13 +02:00
Robbie Averill
358cef0cdf
Merge pull request #8514 from wilr/pulls/lookup-injector
FIX use Injector for FormField::castedCopy
2018-11-07 19:20:36 +02:00
Robbie Averill
9da2899d23
Merge pull request #8560 from creative-commoners/pulls/4.4/random-deprecations
NEW Deprecate RandomGenerator::generateEntropy in favour of using random_bytes directly
2018-11-07 19:09:33 +02:00
Werner M. Krauß
bc0f17fb09 Cleanup Convert
* remove unneeded parenthesis and double quotes
* simplify flow / remove unneeded else
2018-11-07 17:45:01 +01:00
Werner M. Krauß
3f321f935a Convert::memstring2bytes should return integer value
bytes are by nature an integer

fixes #8572
2018-11-07 17:01:36 +01:00
Aaron Carlino
76936d863d Merge branch '4.3' into 4 2018-11-07 23:20:44 +13:00
Loz Calver
11fe5b3adf Implement ConfirmationTokenChain to handle multiple tokens at once 2018-11-07 11:33:24 +13:00
Robbie Averill
9aabe0a0f7 [SS-2018-018] Ignore arguments in mysqli::real_connect backtrace calls 2018-11-07 11:33:24 +13:00
Loz Calver
8d7c2dafab [SS-2018-019] Add confirmation token to dev/build 2018-11-07 11:33:24 +13:00
Loz Calver
02ad0f44aa Implement ConfirmationTokenChain to handle multiple tokens at once 2018-11-07 11:32:55 +13:00
Robbie Averill
5425195238 [SS-2018-018] Ignore arguments in mysqli::real_connect backtrace calls 2018-11-07 11:32:55 +13:00
Loz Calver
af000bea9b [SS-2018-019] Add confirmation token to dev/build 2018-11-07 11:32:55 +13:00
Loz Calver
5563537cc8 Implement ConfirmationTokenChain to handle multiple tokens at once 2018-11-07 11:31:33 +13:00
Robbie Averill
214e28127f [SS-2018-018] Ignore arguments in mysqli::real_connect backtrace calls 2018-11-07 11:31:33 +13:00
Loz Calver
0610f76da0 [SS-2018-019] Add confirmation token to dev/build 2018-11-07 11:31:33 +13:00
Loz Calver
0877442c64 Implement ConfirmationTokenChain to handle multiple tokens at once 2018-11-07 11:24:51 +13:00
Robbie Averill
637b4225c6 [SS-2018-018] Ignore arguments in mysqli::real_connect backtrace calls 2018-11-07 11:24:51 +13:00
Loz Calver
3dbb10625c [SS-2018-019] Add confirmation token to dev/build 2018-11-07 11:24:51 +13:00
Robbie Averill
64c2938c96 Merge branch '4.3' into 4 2018-11-06 11:05:22 +01:00
Robbie Averill
3c58ae009e Merge branch '4.2' into 4.3 2018-11-06 11:05:08 +01:00
Robbie Averill
22c7fa2bc9 Merge branch '4.1' into 4.2 2018-11-06 11:04:43 +01:00
Robbie Averill
6d2665d687 Merge branch '4.0' into 4.1 2018-11-06 11:04:28 +01:00
Werner M. Krauß
adafd73943 Convert::memstring2bytes should preserve -1
fixes #8570
2018-11-06 10:22:13 +01:00
Aaron Carlino
0ba275cb40 Merge branch '4.2' into 4.3 2018-11-06 15:09:01 +13:00
Aaron Carlino
e60cea8561 Merge branch '4.1' into 4.2 2018-11-06 15:08:42 +13:00
Robbie Averill
47fbaebb92
Alter deprecation version numbers
Co-Authored-By: ScopeyNZ <guy@scopey.co.nz>
2018-11-06 00:07:24 +13:00
Sam Minnee
67fe41d00b FIX: Ensure that repeated setting/unsetting doesn’t corrode forceChange() 2018-11-05 23:09:24 +13:00
Sam Minnee
5bb2d9484a FIX: Update “original” DataObject data to be the content of the last write
FIX: Compare to original when determining fields changes

This fixes a number of edge-case issues relating to change detection.

Fixes #8443
Fixes #3821
Fixes #4561
2018-11-05 23:09:24 +13:00
Sam Minnée
536e2d6835
Merge pull request #8511 from jmfederico/patch-1
Update comment about locks in MySQL
2018-11-05 22:32:18 +13:00
Sam Minnee
76255c9fb5 FIX: CheckboxSetField can now save into DBMultiEnum
Fixes https://github.com/silverstripe/silverstripe-framework/issues/1489
2018-11-05 17:40:28 +13:00
Luke Edwards
97180c2612 Fix readonly grid state always being truthy (#8562) 2018-11-02 14:28:47 +13:00
Luke Edwards
8866e7674a BUG: Fix duplicate plugins on HTML editor fields (#8559)
* BUG: Fix duplicate plugins on HTML editor fields

* Add new test
2018-11-02 12:26:53 +13:00
Guy Marriott
2ff7ee6752
NEW Deprecate RandomGenerator::generateEntropy in favour of using random_bytes directly 2018-11-01 19:51:15 +13:00
Michael Strong
55f95b7bc8 BUGFIX many many through not sorting by join table (#8534)
* BUGFIX many many through not sorting by join table

* #8534 added docs to support many many sorting fix

* #8534 added test cases for many_many default sorting
2018-11-01 14:17:15 +13:00
Michael Strong
7086f2ea3a BUGFIX many many through not sorting by join table (#8534)
* BUGFIX many many through not sorting by join table

* #8534 added docs to support many many sorting fix

* #8534 added test cases for many_many default sorting
2018-11-01 13:42:27 +13:00
Luke Edwards
c7b8b80e8b Persist GridField readonly state, add view button (#8535)
* Persist GridField readonly state, add view button

* Minor clarity fixes
2018-11-01 11:12:52 +13:00
Maxime Rainville
0703c1a94e API Deprecating Permission::$declared_permissions and related methods/props 2018-11-01 09:28:05 +13:00
Robbie Averill
98c038688d Add missing deprecation notices to Convert json methods 2018-10-29 22:15:22 +00:00
Andre Kiste
511c368e8c
Merge pull request #8521 from open-sausages/pulls/4.3/searching-for-legacy
Add config to force legacy filter header globally
2018-10-29 14:57:21 +13:00
Robbie Averill
b02a6fa02d FIX Replace usage of Convert JSON methods with json_encode 2018-10-28 21:15:29 +00:00
Robbie Averill
9724d1dd73 API Convert JSON methods are now deprecated, use json_encode or decode instead 2018-10-28 21:13:47 +00:00
Luke Edwards
3284bf48d6 Fix search filtering relations and clear filters (#8477) 2018-10-26 14:43:56 +13:00
Luke Edwards
d879148bff Add config to force legacy filter header globally 2018-10-26 14:28:15 +13:00
Sam Minnée
e72fc9e3d0 FIX DataObject singleton creation (#8516)
Ensure DataObject instances are aware they are singletons so functions like populateDefaults() can be skipped. (fixes #4878)

Correctly applies https://github.com/silverstripe/silverstripe-framework/pull/7850 to the 4.x line
This has already been fixed in 3.x
2018-10-25 11:42:45 +13:00
Will Rossiter
66a404ad1a FIX use Injector for FormField::castedCopy
Allows LookupField to be replaced with user specificed classes.
2018-10-24 12:13:14 +13:00
Federico Jaramillo Martínez
e9bffe4020
Update comment about locks in MySQL
MySQL 5.7.5 and newer allow for multiple lock form the same session. This information is now reflected in the comment.
2018-10-22 22:33:16 -05:00
Maxime Rainville
af46381dca MINOR Correct implementation of single lookup field when valueToLabel returns null 2018-10-23 11:54:26 +13:00
Robbie Averill
bea4101e21 Add tests for DisabledTransformation, PrintableTransformation and PrintableTransformation_TabSet 2018-10-20 20:06:02 +02:00
Robbie Averill
449b2cf291 Add tests for DefaultFormFactory 2018-10-20 19:47:11 +02:00
Robbie Averill
9ceef59e1b Merge branch '4.3' into 4 2018-10-20 18:31:04 +02:00
Robbie Averill
97209bc919 Add edge case unit tests for DateField 2018-10-20 18:15:42 +02:00
Daniel Hensby
88d78dfd95
Merge pull request #8505 from creative-commoners/pulls/4.3/defensive-extensions
FIX getExtensionInstance can return null, add a case to handle that
2018-10-20 16:58:55 +01:00
Robbie Averill
c06cf4820e BUG Readonly and disabled CurrencyFields no longer always returns dollar currency sign, now respect config 2018-10-20 17:47:16 +02:00
Robbie Averill
d56bad7568 Add tests for edge cases in CurrencyField 2018-10-20 17:33:59 +02:00
Robbie Averill
8929b8204f More validation tests for ConfirmedPasswordField 2018-10-20 17:21:25 +02:00
Robbie Averill
c418ee2915 NEW Add getters and setters for public properties in ConfirmPasswordField, add tests
Some of the validation parts of ConfirmPasswordField are previously untested, this adds tests
2018-10-20 16:43:49 +02:00
Robbie Averill
60b375d995 Add more tests for CheckboxField_Readonly and CompositeField, improve PHPDocs 2018-10-20 15:44:23 +02:00
Robbie Averill
3cdb73bd44 NEW Add getLogger() to MonologErrorHandler and add test for exception without one 2018-10-20 15:00:08 +02:00
Robbie Averill
9911c9c9ef Use single quotes and getters over direct prop access in HTTPOutputHandler 2018-10-20 14:51:08 +02:00
Robbie Averill
73df3166b7 Switch to short array syntax in DetailedErrorFormatter, add spaces between array values 2018-10-20 14:30:15 +02:00
Robbie Averill
e211e27470 Add more unit tests for DebugViewFriendlyErrorFormatter, tidy up Director::is_ajax() return 2018-10-20 14:27:57 +02:00
Robbie Averill
7f6f5c9ec9 FIX Flush extra methods cache on DataObjects after each unit test class has finished 2018-10-20 13:59:03 +02:00
Robbie Averill
311fd62d95 FIX getExtensionInstance can return null, add a case to handle that 2018-10-19 18:12:13 +02:00
bergice
a28e2e183e BUG: Fix enum filter in Search component from adding Any as a filter
Fixes #702
2018-10-19 17:05:12 +13:00
Robbie Averill
f4085300ce
Merge pull request #8495 from micmania1/bugfix/828-grapql-asset-admin-memory
BUGFIX #828 optimised query in graphql asset admin
2018-10-18 11:36:51 +02:00
Sam Minnée
24b9dbc8ef
Merge pull request #8490 from creative-commoners/pulls/4.3/minor-db-tweaks
NEW Some minor refactoring of the PDO and MySQLi connectors
2018-10-18 22:11:29 +13:00
micmania1
1e83dff4ed BUGFIX #828 optimised query in graphql asset admin 2018-10-18 18:34:03 +13:00
bergice
a6a1743997 BUG: Fix ENTER not triggering form save button as GridFields used submit type buttons 2018-10-18 12:37:24 +13:00
Robbie Averill
437e53f2fe NEW Some minor refactoring of the PDO and MySQLi connectors
Some small performance optimisations (not using callables in loops, switch strval for string
casting), Config call updates and replace call_user_func_array with direct variadic call.
Also removes some redundant else statements after returns.
2018-10-17 12:54:42 +02:00
Aaron Carlino
57756f38cb Revert bd6c4fd 2018-10-17 14:54:03 +13:00
Robbie Averill
c18e9b1298
Merge pull request #8439 from sminnee/consistent-limit
FIX: Make ArrayList::limit() consistent with DataList::limit()
2018-10-16 12:05:11 +02:00
Aaron Carlino
7d201309ad Merge branch '4.2' into 4 2018-10-15 13:42:55 +13:00
Robbie Averill
516267ed46
Merge pull request #8470 from kinglozzer/suf-fixing-the-suffix
FIX: Re-instate missing SS_DATABASE_SUFFIX functionality (fixes #7966)
2018-10-12 23:11:54 +02:00
Robbie Averill
7215637673
Merge pull request #8460 from open-sausages/pulls/4/lazy-loadable-gidfield
API Add a new GridFieldLazyLoader component
2018-10-11 13:43:10 +02:00
Loz Calver
dca2d47127
Merge pull request #8357 from creative-commoners/pulls/4.3/fix-i18n
FIX Text collector translations now compile without errors
2018-10-11 13:16:23 +02:00
Loz Calver
26f2044533
Merge pull request #8437 from sminnee/faster-cleartable-ss4
FIX: Use DELETE FROM instead of TRUNCATE for clearTable
2018-10-11 12:32:31 +02:00
Loz Calver
ee21c42011 FIX: Re-instate missing SS_DATABASE_SUFFIX functionality (fixes #7966) 2018-10-11 10:50:56 +01:00
Sam Minnee
4740346ed8 FIX: Make ArrayList::limit() consistent with DataList::limit()
This makes it easier to swap one fo the other without code breaking.
Since it’s strictly a removed API, I’ve opted to throw a deprecation
note in SS4 rather than throwing an InvalidArgumentException.

Fixes #2949
2018-10-11 21:05:20 +13:00
Maxime Rainville
250d925810 MINOR Update CompositeField::__construct to call setChildren #8460 2018-10-11 15:25:34 +13:00
Maxime Rainville
98afbfe9b4 Implement Peer review feedback #8460 2018-10-11 14:56:06 +13:00
Maxime Rainville
ef439f9306 MINOR Correct GridField_DataManipulator PHPDOC to not assume DataList
Tweak GridField_DataManipulator to not assume only DataList will be
provided. Use the SS_List Interface instead. (#8460)
2018-10-11 12:06:21 +13:00
Maxime Rainville
2e2ca5a4a7 Make sure LazyLoader still woks after a readonly transofrmation (#8460) 2018-10-11 11:56:39 +13:00
Robbie Averill
eb0ef1c268
Merge pull request #8465 from creative-commoners/pulls/4.3/extensible-bug
NEW Add method to flush extra_methods static cache data and implement into test state
2018-10-11 00:02:27 +02:00
Robbie Averill
3642e7aeae Remove extensionsToRemove and extensionsToReapply, now obsolete 2018-10-10 22:19:15 +02:00
Robbie Averill
bd6c4fdda0
Merge pull request #8440 from creative-commoners/pulls/4.3/its-indestruc-tab-le
NEW TabSet react component is no longer structural
2018-10-09 22:05:53 +02:00
Robbie Averill
56d5621934 FIX Flush extra_methods statics between test runs 2018-10-09 13:22:54 +02:00
Robbie Averill
d1281a571a
FIX Escape HTML in PHPDoc to fix API docs from rendering incorrectly 2018-10-09 10:46:45 +02:00
Maxime Rainville
fdb53311ba Fix linting issue. 2018-10-09 17:32:42 +13:00
Maxime Rainville
bfb6518176 Tweak the logic to empty lazy list. 2018-10-09 17:32:42 +13:00
Maxime Rainville
d2a51471e9 Don't lazy load tab that are not in a TabSet. 2018-10-09 17:32:42 +13:00
Maxime Rainville
5276b6cbb1 API Add FieldList::getContainerField 2018-10-09 17:32:42 +13:00
Maxime Rainville
bdb53979aa API Create a new GridFieldLazyLoader GridField component 2018-10-09 17:32:42 +13:00
Loz Calver
5426f34b4a
Merge pull request #8463 from creative-commoners/pulls/4.3/rm-cachedata
FIX Remove unused cacheData prop from #8451
2018-10-08 15:12:14 +02:00
Loz Calver
e829ad78b1
Merge pull request #8429 from sminnee/fix-2950
FIX: Throw deprecation on limit=0
2018-10-08 15:11:52 +02:00
Robbie Averill
c4788803ee FIX Remove unused cacheData prop from #8451 2018-10-08 12:05:29 +02:00
Maxime Rainville
36b1066413
Merge pull request #8451 from creative-commoners/pulls/4.3/memory-cache-findtemplate
NEW Add memory cache to ThemeResourceLoader::findTemplate()
2018-10-08 10:38:07 +13:00
Sam Minnee
e5d3b28a4d FIX: Don’t break validation on selects without a source.
Fixes cases where there are no valid values or an empty-string
value is manually added rather than using setEmptyString()

Fixes #4849
Fixes #7159
2018-10-06 11:53:17 +13:00
Sam Minnée
7915fe0c0f
Merge pull request #8303 from hchokshi/pulls/4.2/viewable-data-customised-isset
Implement __isset for ViewableData_Customised
2018-10-06 09:37:19 +13:00
Robbie Averill
98568262f2 Fixed phpcs violations 2018-10-05 16:07:33 +02:00
Robbie Averill
024762f03b Move default themes lookup before cache check 2018-10-05 15:00:32 +02:00
Robbie Averill
da9301f241 Use SilverStripe cache API instead of memory cache, add tests and fix cache config indentation 2018-10-05 14:58:48 +02:00
Robbie Averill
172d8915b7 Clear cache between ThemeResourceLoader tests 2018-10-05 14:12:26 +02:00
Robbie Averill
9ea7b58a8f NEW Add memory cache to ThemeResourceLoader::findTemplate()
For large sites, this reduces the number of file_exists, Path::join, getThemePaths etc
calls and can contribute to 26% reduction in TTFB load time
2018-10-05 14:12:26 +02:00
Sam Minnee
0fc06e51e5 FIX: Drop seconds from DBDatetime::Nice() to restore SS3 behaviour.
Note that the medium date format depends on locale, with en_NZ being
resolutely numeric. I’ve updated the test to verify a couple of locales
to make this more obvious.

Fixes #8121
2018-10-04 14:51:24 +13:00
Sam Minnee
638e6ec281 FIX: Throw deprecation notice on limit=0
The SS4 behaviour of limit=0 is unlikely to be the SS5 behaviour.
To clear the limit limit=null is recommended.

In addition, there’s a bit tighter type maintenance in the internal
limit data (ensure things are int).

Fixes #2950.
2018-10-04 10:38:15 +13:00
Robbie Averill
ee24413c30 Merge branch '4.2' into 4 2018-10-03 15:28:05 +02:00
Robbie Averill
b0871ebd75
Merge pull request #8417 from creative-commoners/pulls/4.3/many-many-through-sorting-tests
Add more list sorting tests and fix many many through sorting
2018-10-03 13:30:20 +02:00
Robbie Averill
d2b646cc13
Merge pull request #8286 from wilr/patches/mysql-create-table-issue
Check database has table before altering.
2018-10-03 13:24:59 +02:00
Robbie Averill
d74fed554a
Merge pull request #8427 from sminnee/fix-1397
FIX: Append any fields that don’t match name in insertBefore/insertAfter
2018-10-03 13:22:23 +02:00
Robbie Averill
6a5fb4999c
Merge pull request #8416 from lekoala/patch-14
raw2att accepts array, but sprintf doesn't
2018-10-03 13:21:43 +02:00
Robbie Averill
7f685b0bea
Merge pull request #8423 from creative-commoners/pulls/4.2/default-locale-for-members
FIX New members now receive the configured default locale, not the current locale
2018-10-03 13:18:05 +02:00
Robbie Averill
79f9d6b733
Merge pull request #8428 from sminnee/fix-2636
FIX: Don’t change state in ArrayList::getIterator()
2018-10-03 13:11:39 +02:00
Raissa North
90afb2037a NEW TabSet react component is no longer structural 2018-10-03 16:36:17 +13:00
Robbie Averill
cb2b9498fb API Deprecate updateSearchContextCallback and updateSearchFormCallback 2018-10-03 13:47:40 +13:00
Luke Edwards
bf60a699a5 Add extension points for ModelAdmin search API 2018-10-03 13:47:40 +13:00
Sam Minnee
0cc72c91ad FIX: Use DELETE FROM instead of TRUNCATE for clearTable
clearTable is mainly used for clearing data between tests. In this case,
there are very few or zero records, and DELETE FROM is quicker than
TRUNCATE, which works by deleting and recreating the table.

This materially speeds up test execution, at least on MySQL.

Cherry-pick of SS3 ae9ab22a8f
2018-10-03 13:40:00 +13:00
Guy Marriott
5970fc2417
FIX Moving test to correct director 2018-10-03 10:47:17 +13:00
Robbie Averill
5a20bb5e20 Revert "FIX: Use DELETE FROM instead of TRUNCATE for clearTable"
This reverts commit 79c2b5ad42.
2018-10-02 14:35:10 +02:00
Robbie Averill
c8e7672ede
Merge pull request #8414 from creative-commoners/pulls/4/searching-for-a-name-conflict
FIX Avoid having search fields with the same names as form elements
2018-10-02 13:43:59 +02:00
Robbie Averill
2ca089bcce
Merge pull request #8433 from sminnee/faster-cleartable
FIX: Use DELETE FROM instead of TRUNCATE for clearTable
2018-10-02 10:43:54 +02:00
Sam Minnee
79c2b5ad42 FIX: Use DELETE FROM instead of TRUNCATE for clearTable
clearTable is mainly used for clearing data between tests. In this case,
there are very few or zero records, and DELETE FROM is quicker than
TRUNCATE, which works by deleting and recreating the table.

This materially speeds up test execution, at least on MySQL.

Implemented in SS3 at 815da76b056a716c8831d22bbf93528912cbcb28
2018-10-02 18:00:38 +13:00
Sam Minnee
f2cbc1dfbb FIX: Don’t use USE_FRM in MySQL repair. Fixes #6300.
USE_FRM is a sufficiently dangerous option that it should require
manual DBA activity to carry out.

See http://dev.mysql.com/doc/refman/5.7/en/repair-table.html for more
info.
2018-10-02 10:48:47 +13:00
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
Sam Minnee
ad87890b2e FIX: Don’t change state in ArrayList::getIterator()
This prevents the map-to-ArrayData conversion from changing object
state and making the result of toArray() non-deterministic.

Fixes #2636. Other solutions were suggested on that ticket, but there is
no way of putting special code in for a SSViewer-specific iterator, and
having object state pre-emptively converted to ArrayData would
be an SS5-level change.
2018-10-02 09:56:09 +13:00
Maxime Rainville
755907d117
Merge pull request #8409 from open-sausages/pulls/4/treedropdown-caching
MINOR Add caching to the TreeDropdownField tree action
2018-10-01 13:56:21 +13:00
Guy Marriott
c503dbd634
Prefixing search filters for the React search form context 2018-10-01 13:38:32 +13:00
Maxime Rainville
13c89d0ed0 Add a comment and only apply caching if using the standard NumChildrenMethod 2018-10-01 11:29:51 +13:00
Harsh Chokshi
60dd5f288b Implement __isset for ViewableData_Customised
Resolves #8302.
2018-10-01 09:40:12 +13: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
ac1fe5e9d5 FIX joinClass's default_sort is used when nothing else has been set already 2018-09-28 15:39:24 +02:00
Robbie Averill
4d14e9b6b1
Merge pull request #8421 from creative-commoners/pulls/4.3/psr-5-deprecations
Update deprecation PHPDocs to be PSR-5 compliant
2018-09-28 14:18:54 +02:00
Loz Calver
10ff6c4f81
Merge pull request #8418 from creative-commoners/pulls/4.3/lower-complexity
MINOR Reduce some code complexity, update array syntax and injected SQLSelect etc
2018-09-28 12:51:08 +02:00
Robbie Averill
e4768e44b0 Use splat over call_user_func_array and reduce calls to func_get_args() 2018-09-28 12:32:20 +02:00
Robbie Averill
e57edcd060
Merge pull request #8387 from sminnee/fix-start-session-without-headers
FIX: Ensure existing session can be accessed if headers_sent()
2018-09-28 10:59:29 +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
Loz Calver
aec562f048
Merge pull request #8419 from 3Dgoo/patch-1
minor i18nEntityProvider.php API documentation fix
2018-09-28 10:21:37 +02:00
Sam Minnee
b98c87a6c5 FIX: Ensure existing session can be accessed if headers_sent()
If a session already exists, and Session::start() isn’t called until
after a large enough block of content is output, then headers_sent()
will be false. The previous code prevented the session from being
started in this case. That might makes sense for the creation of a new
session, but it prevent legitimate access to an existing session.

This mostly manifested when running debugging tools such as showqueries,
which may output content before the session is started.
2018-09-28 13:25:13 +12:00
3Dgoo
785b0c69da
minor i18nEntityProvider.php API documentation fix
Fixing documentation typo.
2018-09-28 10:28:00 +10:00
Ingo Schommer
25759ffc5f NEW Show file path on PHP parser exceptions 2018-09-28 08:58:47 +12:00
Robbie Averill
1b0293d8c5 Replace array syntax, use some strict comparison and remove unnecessary elseif 2018-09-27 17:37:37 +02:00
Robbie Averill
594fa30b82 Remove redundant elseif complexity and switch to short array syntax 2018-09-27 17:29:52 +02:00
Robbie Averill
adb4d1f92d MINOR Reduce some code complexity, update array syntax and injected SQLSelect etc 2018-09-27 16:40:23 +02:00
Thomas Portelange
fdd5acff5d
raw2att accepts array, but sprintf doesn't
it's not very likely to happen (it did in my case :-) ) but if the value is an array, sprintf will fail (because raw2att accepts array, but sprintf doesn't). i suggest to json encode any array data to ensure it's safely included in the html. Or we should throw proper exceptions to make sure invalid values do not result in a php error.
2018-09-27 12:12:59 +02:00
Guy Marriott
c54e7317d2
FIX Avoid having search fields with the same names as form elements 2018-09-27 17:39:50 +12:00
Thomas Portelange
f103648f8c
value can be something else than a string
if the value is not a string (an array for instance), sprintf will fail
2018-09-26 11:35:40 +02:00
Sam Minnée
a31a496362
Merge pull request #8399 from lekoala/patch-12
var_export does not handle circular references
2018-09-26 20:58:25 +12:00
Maxime Rainville
77339b7e75 MINOR Add caching to the TreeDropdownField tree action 2018-09-26 17:24:06 +12:00
Robbie Averill
f5929d87e0 DOCS Update do blocks for DataQuery::having() to reflect correct input types 2018-09-25 17:46:42 +02: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
3eacecbb1c
Merge pull request #8398 from open-sausages/pulls/4/test-flush
FIX Don't flush manifests in tests by default
2018-09-25 00:19:32 +02:00
Robbie Averill
0276f6c089 FIX Revert semver break in adding GridField type hint to method signature 2018-09-24 13:39:33 +02:00
Thomas Portelange
72b25d1a97
var_export does not handle circular references
this often happens in SilverStripe, a plain print_r is much safer
2018-09-24 12:31:06 +02:00
Loz Calver
f01473f1b3
Merge pull request #8390 from caffeineinc/bugfix/8389-login-attempt-performance-issues
Performance issues with BasicAuth and LoginAttempts
2018-09-24 10:24:29 +02:00
Ingo Schommer
a2bb70c46d FIX Don't flush manifests in tests by default
It's massively slowing down test execution,
particularly for rapid execution through test-driven-development (TDD)
2018-09-24 18:12:35 +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
Andre Kiste
e8fd49b394
Merge pull request #8381 from open-sausages/pulls/4.2/sort-out-your-field
BUG Changes being detected on TreeMulti as values not sorted
2018-09-21 16:38:56 +12:00
Luke Edwards
4ac4cdc91b
Merge pull request #8348 from caffeineinc/bugfix/3357
BUG Add GridField Readonly Transformation (#3357)
2018-09-21 14:54:37 +12:00
Damian Mooyman
1d5ecd342e
BUG Prevent error on valid response status codes 2018-09-21 14:54:26 +12:00
Simon Gow
c269a987d5 Performance issues with BasicAuth and LoginAttempts
Two functions interact with the LoginAttempt object which when used in conjunction with BasicAuth result in significant performance degradation over time, as the LoginAttempts Table fills.

This fix adds an index to the lookup column EmailHashed and removes the Email filter part of getByEmail() so it can use the index resulting in a much faster query.

For more information see https://github.com/silverstripe/silverstripe-framework/issues/8389
2018-09-20 13:34:03 +12:00
Luke Edwards
3fc49dd4ce Lint fixes and allow a few other components by default 2018-09-20 13:32:52 +12:00
Robbie Averill
3b7802bb51
Merge pull request #8388 from sminnee/showqueries-backtrace
NEW: Add ?showqueries=backtrace
2018-09-19 11:21:36 +02:00
Sam Minnee
40dde226fd NEW: Add ?showqueries=backtrace
This variant of showqueries will include a backtrace after each query.
This is extremely verbose but can be helpful when diagnosing where
queries have come from.

This is something that I have frequently added as a local hack on my
environment, I figured that exposing it as a formal feature would be
useful.
2018-09-19 14:28:40 +12:00
Luke Edwards
db63f55fbb BUG Changes being detected on TreeMulti as values not sorted 2018-09-18 13:24:55 +12:00
Raissa North
588bf83e12 NEW Add hideNav flag to schema defaults 2018-09-18 10:45:36 +12:00
Luke Edwards
a33866ff4c
Merge pull request #8353 from open-sausages/pulls/4.2/2227-show-link-tracking
API: Add Link Tracking section to Relations developer guide
2018-09-13 14:23:34 +12:00
bergice
01db5c9e98 API: Add Link Tracking section to Relations developer guide and describe show_sitetree_link_tracking, show_file_link_tracking.
Refactor form scaffolder.
2018-09-13 11:02:09 +12:00