Commit Graph

1768 Commits

Author SHA1 Message Date
Serge Latyntcev
3d777cfb8a Backward compatible behaviour for SQLConditionalExpression::getJoins 2019-05-02 15:39:36 +12:00
Ingo Schommer
0696045e59 NEW Legacy thumbnail migration task (#8924)
* NEW Legacy thumbnail migration task

See https://github.com/silverstripe/silverstripe-assets/issues/235
Makes a start at https://github.com/silverstripe/silverstripe-assets/issues/219 as well

* API Removed migrate_legacy_file support

For the vast majority of sites, you really don't want to run your file migration as part of dev build.
The step is involved enough to warrant it's own task.
I don't think this is an API change, since the setting won't have affect
for anyone who has already enabled it - they would've already done the one-off migration.

See https://github.com/silverstripeltd/open-sourcerers/issues/91
and https://github.com/silverstripe/silverstripe-assets/issues/235
2019-05-02 09:33:53 +12:00
Guy Marriott
ecfe039e72
FIX Don't add "better buttons" previous and next without a paginator 2019-05-01 15:48:03 +12:00
Andre Kiste
0c6c57f1ef Add getFieldMap method to retrieve a list of all fields for any giv… (#8892)
* Add `getFieldMap` method to retrieve a list of all fields for any given class

* Add `TagsToShortcodeTask` to upgrading guide

Adding after the file migration part as this is where it makes the most sense to run it.

* `getFieldMap` accepts an array

* Move to `DataObjectSchema`

* Add `HTMLVarchar` to documentation
Minor refactoring

* Add test for checking that `subclassesfor` works without the base class
Add test `DataObjectSchema::getFieldMap` returns the correct array

* Remove cms dependency
2019-04-30 10:43:14 +12:00
Andre Kiste
2bcf8b5ff3 More verbose file migration logging
See https://github.com/silverstripeltd/open-sourcerers/issues/91

* Add `PreformattedEchoHandler`

cherry-picked from 4c3f3e6bea99b46b689e5b23d1bd1498a4ac696c

* Batch log messages for every 100 file.
Also make logger work for stdout

* Update src/Logging/PreformattedEchoHandler.php

Co-Authored-By: bergice <bergice@users.noreply.github.com>
2019-04-30 08:54:48 +12:00
Robbie Averill
8c6bf7ce53 Merge branch '4.3' into 4.4 2019-04-21 11:09:25 +12:00
Robbie Averill
523456ae09
Merge pull request #8921 from creative-commoners/pulls/4.3/threshold-count-in-sql
FIX Calculate threshold condition with SQL rather than PHP
2019-04-21 01:25:24 +12:00
Guy Marriott
80ad336e97 NEW Add API to create a generator from a DataList (#8931) 2019-04-18 15:31:41 +12:00
Aaron Carlino
c63eecc3e1 Merge branch '4.3' into 4 2019-04-18 11:57:36 +12:00
Guy Marriott
da1af3d8b0
FIX Postgres booleans should return as int for consistency 2019-04-17 15:15:17 +12:00
Sam Minnée
6a2762662b MINOR: Change “Choose Page” to “Search or choose Page” (#8766)
* MINOR: Change “Choose Page” to “Search or choose Page”

Based on discussions with James Ford, it wasn’t clear that you could
search.

* Use new translation key
2019-04-16 16:06:37 +12:00
Guy Marriott
9d6b5048a6 FIX Table aliases are retained on base tables in queries built using SQLConditionalExpression (#8918)
* Adding failing test for base table aliases using SQLSelect

* FIX Retain table aliases applied to the base table on queries

* FIX Move the trimmed alias outside of the condition so we can use it within the condition
2019-04-16 15:40:09 +12:00
Guy Marriott
7fd6e14423
Adding comment about the === 't' condition for supporting postgres 2019-04-16 12:10:13 +12:00
Guy Marriott
a48beac845
FIX Calculate threshold condition with SQL rather than PHP
This is a performance fix. Modern SQL engines can avoid counting a whole result set (potentially thousands of records) when you are only interested if the count exceeds a threshold.
2019-04-15 16:48:44 +12:00
Sheila Bañez
63360f8048 BUG Replace substr with mb_substr to get the correct position 2019-04-15 16:38:52 +12:00
Guy Marriott
b1339f0d72 NEW Update FieldList::replaceField API to match removeByName (#8876)
* API Update FieldList::replaceField API to match removeByName

This specifically adds the parameter that `removeByName` has but `replaceField` does not. This parameter is set to `true` by default rather than inheriting the same default as `removeByField`. This is because the existing funtionality of `replaceField` was the same as if this parameter was set to `true`. This should be updated in SS5 to match the `removeByField` API.

* Add dataFieldOnly to CompositeField
2019-04-15 16:22:54 +12:00
Ralph Slooten
66c372ce28 Include baseURL with relative setGetVar() links (#8834)
* Return baseURL with setGetVar

* Adjust testSetGetVar tests for base url
2019-04-15 14:50:46 +12:00
Robbie Averill
2c971eea83 Merge branch '4.3' into 4 2019-04-11 11:37:47 +12:00
Robbie Averill
f2f28586d9 Merge branch '4.2' into 4.3 2019-04-11 11:37:34 +12:00
Robbie Averill
116ea12783 Merge branch '4.1' into 4.2 2019-04-11 11:37:22 +12:00
Robbie Averill
f4a6115ee6 Merge branch '4.0' into 4.1 2019-04-11 11:36:40 +12:00
Robbie Averill
8a06682e31 Merge branch '4.3' into 4
# Conflicts:
 #	src/ORM/Connect/DBSchemaManager.php
2019-04-11 11:24:17 +12:00
Robbie Averill
55cbacca86 Merge branch '4.2' into 4.3
# Conflicts:
 #	src/Forms/GridField/GridFieldLevelup.php
 #	src/includes/constants.php
2019-04-11 11:21:42 +12:00
Sam Minnee
f12fa62ad6 FIX: Better error message when GridFieldLevelup passed bad record details
Fixes https://github.com/silverstripe/silverstripe-framework/issues/3519
2019-04-08 18:09:51 +12:00
Loz Calver
594af77134 FIX: prevent unnecessary field alterations for enums with empty defaults 2019-04-05 16:17:41 +01:00
Robbie Averill
8b4b54f264
PHPCS linting error on indentation 2019-04-05 16:29:24 +13:00
Sam Minnee
c9c7c0c825 FIX: Fix PDO cached statement column coercion
NEW: Add PDOStatementHandle class that is now what PDOQuery expects
2019-04-05 15:11:21 +13:00
Sam Minnee
45e1fcaf30 FIX: Correct type coercion of MySQL 2019-04-05 15:11:21 +13:00
Sam Minnee
adb6e9eb8d FIX: Perform type coercion on PDO-based MySQL and SQLite connections
It turns out that this is needed for decimal values on MySQL and all
values on SQLite
2019-04-05 15:05:42 +13:00
Ingo Schommer
afb3c825c9
Merge pull request #8890 from open-sausages/pulls/4/get-installer-to-self-create-assets-folder
BUG Update installer to create the assets folder if its missing
2019-04-05 14:41:01 +13:00
Ian Patel
759968bbe2 Fix Undefined variable: result when catch Exception 2019-04-05 11:33:01 +13:00
Guy Marriott
a9d57f5bfb
Merge pull request #8241 from creative-commoners/pulls/4.3/separate-logging
Separate core error logging from standard LoggerInterface
2019-04-05 08:49:09 +13:00
Rafael Marins de Sousa
68337bd8be Including is_array validation to getEnv method. When SS website is deployed to FortRabbit .env file is read as string what causes the website to crash, due to the lack of type check at getEnv method. 2019-04-04 15:41:13 +13:00
Maxime Rainville
c84ad4278f BUG Update installer to create the assets folder if its missing 2019-03-29 17:56:39 +13:00
Aaron Carlino
fc6213c293 Merge branch '4.3' into 4 2019-03-27 13:25:57 +13:00
Aaron Carlino
9eac374b13 Use strcasecmp 2019-03-27 12:40:56 +13:00
Jonathon Menz
fae19c16b5 FIX has_one File form scaffolding
Only allow selection of a single file when scaffolding has_one File relationship (fixes #8862)
2019-03-26 09:50:59 -07:00
Damian Mooyman
6dc41e50a0
MINOR Linting fixes 2019-03-26 17:35:58 +13:00
Damian Mooyman
83ec0b69fa
BUG Resolve issue where schema changes between enum / non-enum types 2019-03-26 14:16:05 +13:00
Loz Calver
8483a9644c
Merge pull request #8874 from johannesx75/fix-pdoconnector-generatedid-type-2
Fix PDOConnector GeneratedID return type
2019-03-22 09:09:23 +00:00
Daniel Hensby
6d4d332448
Merge pull request #8830 from ntd/pr7
Fix #8829: mention get_one does not escape field names
2019-03-21 14:38:34 +00:00
Johannes Hammersen
e1190e33d2 Fix PDOConnector GeneratedID return type 2019-03-21 09:26:14 +01:00
Kong Jin Jie
1d406c64b9 Fix: Allow editing of relation if item is created. 2019-03-20 12:51:49 +08:00
Aaron Carlino
f6a7bddd8d Linting 2019-03-20 15:50:54 +13:00
Aaron Carlino
388baa01b4 Fix linting 2019-03-20 13:19:10 +13:00
Aaron Carlino
aa491d9294 Fix tests 2019-03-20 12:33:00 +13:00
Aaron Carlino
39a29fa2f6 ENHANCEMENT: has_extension() should allow injector overrides 2019-03-20 12:33:00 +13:00
Damian Mooyman
6b450395ce API Allow empty arraylists to be typed (#8866)
* API Allow empty arraylists to be typed

* PHPCBF fixes
2019-03-20 11:46:35 +13:00
Robbie Averill
0777ab5ee7
Merge pull request #8847 from blueo/pulls/optional-test-teardown
Add option to leave Temp DB when exiting
2019-03-19 15:58:31 +13:00
Bernard Hamlin
8d1a238e97 Add option to leave Temp DB when exiting 2019-03-19 14:37:13 +13:00
Loz Calver
ca781c684d FIX: RequestHandler::__construct() should run after middlewares (fixes #8848) 2019-03-11 11:08:03 +00:00
Nicola Fontana
252397d8d1 Fix #8829: mention get_one does not escape field names 2019-03-08 08:20:47 +01:00
Dan Hensby
765d1568ab
Merge branch '4.3' into 4 2019-03-06 11:04:50 +00:00
Dan Hensby
a8605b04e0
Merge branch '4.2' into 4.3 2019-03-06 11:04:14 +00:00
Dan Hensby
7e34167ddf
Merge branch '4.1' into 4.2 2019-03-06 11:01:17 +00:00
Dan Hensby
625e6d5f54
Merge branch '4.0' into 4.1 2019-03-06 11:00:41 +00:00
Guy Marriott
f8f6983773
Merge pull request #8793 from wilr/pulls/orm-exception
Throw error message when searchable_field does not return a object
2019-03-06 08:50:50 +13:00
Daniel Hensby
7416ce275b
FIX doInit comparison should be lowercased 2019-03-05 19:01:12 +00:00
Damian Mooyman
d1396b7dfe
BUG Fix writeBaseRecord with unique indexes
Fixes #6819
2019-02-27 16:40:12 +13:00
Maxime Rainville
11b9429c34 Merge branch '4.3' into 4 2019-02-27 12:14:51 +13:00
Maxime Rainville
651d537196 Merge branch '4.2' into 4.3 2019-02-27 12:13:24 +13:00
Maxime Rainville
ed013fcfbb Merge branch '4.1' into 4.2 2019-02-27 12:12:39 +13:00
Maxime Rainville
ac53f77115 Merge branch '4.0' into 4.1 2019-02-27 12:11:47 +13:00
Robbie Averill
7ab55a4948 Add LoggerState to disble user-configured logging during PHPUnit tests 2019-02-22 11:43:01 +07:00
Maxime Rainville
9a59f2f57d BUG Renable the ability to do dynamic assignment with DBField 2019-02-22 11:08:43 +13:00
Robbie Averill
3e90fdf42f Merge branch '4.3' into 4 2019-02-19 08:41:05 +07:00
Robbie Averill
ed74549c4f Merge branch '4.2' into 4.3 2019-02-19 08:39:59 +07:00
Robbie Averill
79e44b42fa Merge branch '4.1' into 4.2 2019-02-19 08:37:07 +07:00
Robbie Averill
cb7f15a681 Merge branch '4.0' into 4.1 2019-02-19 08:36:41 +07:00
Aaron Carlino
09c539e1c3 Merge branch '4.3' into 4 2019-02-19 12:21:24 +13:00
Maxime Rainville
25bba49923 [SS-2018-021] Fix potential SQL vulnerability in non-scalar value hyrdation 2019-02-19 12:20:24 +13:00
Robbie Averill
7a508af387
Merge pull request #8795 from creative-commoners/pulls/4.3/improve-foreign-key-form-field-scaffolding
FIX Caching the result of counting a foreign list for performance
2019-02-12 15:56:11 +07:00
Maxime Rainville
95505db7d6 [SS-2018-021] Fix potential SQL vulnerability in non-scalar value hyrdation 2019-02-12 21:08:09 +13:00
Maxime Rainville
fd90cf6ceb [SS-2018-021] Fix potential SQL vulnerability in non-scalar value hyrdation 2019-02-12 20:44:17 +13:00
Guy Marriott
0ac43ce025
FIX Caching the result of counting a foreign list for performance 2019-02-12 15:28:03 +13:00
Will Rossiter
d4f6ff98c8 Throw error message when searchable_field does not return a object
While upgrading 4.2 to 4.3 the behaviour of GridFieldFilterHeader has changed (example code: https://gist.github.com/wilr/7c59f577e1d072eb66e4c0c84cba6732).

This patch doesn’t affect the behaviour (since the explict object is a better API) but it makes upgrading easier to identify the field.
2019-02-12 09:39:27 +13:00
Damian Mooyman
b8122f88c5
Merge pull request #8174 from creative-commoners/pulls/4.2/deprecated-fixture-state
MINOR Replace use of deprecated getFixtureFactory() with FixtureTestState
2019-02-11 14:16:37 +13:00
Robbie Averill
a104b5b48f
Merge pull request #8769 from creative-commoners/pulls/4.0/escape_for_like
FIX Escape wildcard characters when matching database name in databaseExists
2019-02-10 08:26:28 +03:00
Loz Calver
7c5b73881b FIX: Prevent null->null being flagged as a value change (fixes #8774) 2019-02-06 13:24:18 +13:00
Guy Marriott
b2e18dda9c
Merge pull request #8783 from open-sausages/pulls/4/docs-dataobject-update
DOC Clarify DataObject->update() use
2019-02-04 21:45:13 +13:00
Ingo Schommer
a78573b517 DOC Clarify DataObject->update() use 2019-02-04 20:47:27 +13:00
Robbie Averill
7775f82584 FIX Handle falsy return value when setting form field value in setAuthenticatorClass() 2019-02-01 19:39:15 +03:00
Robbie Averill
ebfab45e23 API LoginForm::authentiator_class is now deprecated, use getters or setters instead 2019-02-01 19:39:15 +03:00
Robbie Averill
3d5c330e17
Merge pull request #8558 from open-sausages/pulls/4/deprecating-declared-permissions
API Deprecating Permission::$declared_permissions and related methods/props
2019-01-30 19:48:41 +02:00
Maxime Rainville
8ec9c50c58 DOCS Correct documentation for ExecMetricMiddleware 2019-01-30 13:58:09 +13:00
Maxime Rainville
868258926f
Implement feedback on PSR-19 compatibility 2019-01-30 11:57:17 +13:00
Guy Marriott
f918dcd36a
FIX Escape wildcard characters when matching database name in databaseExists 2019-01-30 09:31:13 +13:00
mikeyc7m
0491ca03cf FIX prevent death on urls with querystrings & anchors 2019-01-29 13:15:14 +02:00
Robbie Averill
b0fc161235
Merge branch '4' into pulls/4/deprecating-declared-permissions 2019-01-29 09:33:44 +02:00
Andre Kiste
d2c8530fec
Merge pull request #8733 from open-sausages/pulls/4/add-exectmetric-url-debug-param
NEW Add new execmetric debur URL parameter to print out exection time and peak memory usage
2019-01-29 18:49:10 +13:00
Maxime Rainville
c4bf06f600 NEW Add new execmetric debug URL parameter to print out exection time and peak memory usage 2019-01-29 17:28:28 +13:00
Maxime Rainville
a589bcb092
Merge pull request #8729 from emteknetnz/bugfix/htmlvalue-getcontent
Ensure document is not falsey before attempting to clone it
2019-01-29 09:11:04 +13:00
Loz Calver
785e9f123f Replace self:: with static:: for shortcode methods 2019-01-28 14:51:34 +00:00
Robbie Averill
dc9d1b9cc0 FIX GridFieldPrintButton no longer assumes that children of GridField would implement their own print template 2019-01-28 11:45:55 +02:00
Guy Marriott
fad221bf1c
Merge pull request #8756 from open-sausages/pulls/4/string-cast-dropdownfield-entry-title
MINOR Always cast formfield display value as a string to avoid 0 being blank
2019-01-28 12:09:20 +13:00
Guy Marriott
7ee0dff391
Merge pull request #8745 from open-sausages/pulls/4/add-extra-message-to-MigrateFileTask
MINOR Add message to inform user that the task can be run again
2019-01-28 09:24:00 +13:00
Maxime Rainville
db466fb013 MINOR Always cast formfield display value as a string to avoid 0 being blank 2019-01-25 13:34:36 +13:00
Benedikt Seidl
d530bc2fb6 fix user feedback when jquery could not be loaded 2019-01-24 20:51:48 +01:00
Robbie Averill
d8cd085190 Merge branch '4.3' into 4 2019-01-24 17:14:09 +02:00
Maxime Rainville
39297b8640 MINOR Add message to inform user that the task can be run again without issue 2019-01-23 18:40:15 +13:00
Simon Gow
c28670ebed #8724 - Session timeout regression
Only emit the session refresh cookie if the session timeout is set.
2019-01-18 10:07:53 +13:00
Simon Gow
af08328e8e Existing sessions need to set a new cookie on each request, if the
session exists, otherwise our expiry is never updated and sessions
can't roll on every request.
2019-01-17 17:37:35 +13:00
Steve Boyd
7ea218aa1c Ensure document is not falsey before attempting to clone it 2019-01-16 16:24:45 +13:00
Maxime Rainville
13486ca80e MINOR Add unit test for Requirements::add_i18n_javascript() 2019-01-16 10:36:53 +13:00
Maxime Rainville
c6214b855f MINOR Update add_i18n_javascript to load lowercase-dash language files 2019-01-15 15:04:39 +13:00
Damian Mooyman
34ac228029
BUG Fix issue with assertListEquals() ignoring field getters 2019-01-11 11:35:11 +13:00
Aaron Carlino
ab5bbda88c Merge branch '4.3' into 4 2019-01-10 12:31:27 +13:00
Maxime Rainville
1e01deea39 NEW Make resources dir configurable (#8519)
* NEW Make resources dir configurable.

* Removing reference to old `resources` and updating doc #8519

* Rrtarget to 4.4 release.

* DOC Reference SS_RESOURCES_DIR in Environment doc.

* API Add a Resources method to SilverStripe\Core\Manifest\Module to read the resources-dir from composer.json

* Clean up reference to SS_RESOURCES_DIR env var

* Set default resources-dir

* Update test to use RESOURCES_DIR const in expected resource url method

* Correcting typos

Co-Authored-By: maxime-rainville <maxime@rainville.me>

* MINOR Correctubg minor typos

* DOCS Document the intricacies of exposing static assets.
2019-01-09 15:35:45 +13:00
Robbie Averill
068c240d38
Update src/Core/CustomMethods.php
Co-Authored-By: jchenevey <jchenevey@users.noreply.github.com>
2019-01-08 15:27:38 -05:00
Joe Chenevey
3730d84d18
Update CustomMethods.php
Switch to an early `continue` rather than wrapping contents of `foreach` in an `if` and indenting.
2019-01-08 15:24:21 -05:00
Joe Chenevey
afceccb9a6
CustomMethods->removeMethodsFrom Warnings
Check to ensure `self::$extra_methods[$class][$method]` exists before trying to retrieve its value. Silences warnings generated by updating a controller's failover.
2019-01-08 15:14:23 -05:00
Robbie Averill
7c96feef37 Merge branch '4.3' into 4 2019-01-08 12:27:48 +01:00
Robbie Averill
394dd4765c NEW Scaffolded field labels now only have an uppercased first word 2019-01-07 17:52:28 +01:00
Kong Jin Jie
1667af8f5e Add $disabledItems to check for disabled items instead of checking against $defaultItems
Fixes #8688
2018-12-31 17:25:11 +08:00
Russell Michell
0397c54b5a FIX: Fixes #8459
- Missing conditionals for optional constructor args
- Missing calls to FieldList::setForm()
- Missing guards around naive calls to Form::Fields()->foo()
2018-12-19 13:28:19 +13:00
Simon Gow
d01585cc98 #8543 Resolve Duplicate Headers
- fix linting
2018-12-19 12:39:32 +13:00
Simon Gow
1edfa4d956 #8543 Resolve Duplicate Headers
- Replace session name lookup with function to also check secure cookies
- Added timeout which defaults to 0 (same as PHP)
- Removed php7 style of session_start from PR
- moved session_start into headers sent block to prevent warnings.
2018-12-19 12:39:32 +13:00
Simon Gow
4eb6669c08 #8543 Resolve Duplicate Headers
Put cookie_lifetime back into the session parameters.
2018-12-19 12:39:32 +13:00
Simon Gow
2deb8f4176 Resolve Duplicate Headers
Ensure only a single Set-Cookie header is returned from Session once
we have data to save. Include backwards compatibility for PHP56
2018-12-19 12:39:32 +13:00
Maxime Rainville
7f6b80f87d Correct session doc typo 2018-12-14 13:01:22 +13:00
Guy Marriott
87b74b9cc1
Correcting Max's eggrigious typos
Co-Authored-By: maxime-rainville <maxime@rainville.me>
2018-12-13 13:50:35 +13:00
Maxime Rainville
6e214e2e8b DOCS Updating Session doc to reflect that you need to operation on an instance. 2018-12-13 11:05:49 +13:00
Robbie Averill
470093de2f
Merge pull request #8650 from sminnee/nested-vendor
FIX: Manifest should ignore vendor folders within packages contained in vendor
2018-12-12 19:52:03 +00:00
Aaron Carlino
ab116cd5d9 Merge branch '4.1' into 4.2 2018-12-12 15:56:53 +13:00
Robbie Averill
74698af402 [SS-2018-020] Ensure that table names are escaped to prevent possible SQL injection 2018-12-11 20:57:18 +13:00
Robbie Averill
8bd747d12a [SS-2018-020] Ensure that table names are escaped to prevent possible SQL injection 2018-12-11 20:56:55 +13:00
Robbie Averill
fecedc2d98 [SS-2018-020] Ensure that table names are escaped to prevent possible SQL injection 2018-12-11 20:56:40 +13:00
Robbie Averill
48bd335648 [SS-2018-020] Ensure that table names are escaped to prevent possible SQL injection 2018-12-11 20:55:58 +13:00
Robbie Averill
5d7c5ffb07 Merge branch '4.3' into 4 2018-12-06 09:40:40 +00:00
Robbie Averill
08866f89d9 Merge branch '4.2' into 4.3 2018-12-06 09:40:05 +00:00
Robbie Averill
96bd17d469 Merge branch '4.1' into 4.2 2018-12-06 09:38:45 +00:00
Robbie Averill
3f532466d1 Merge branch '4.0' into 4.1 2018-12-06 09:37:52 +00:00
Guy Marriott
6edcbe9086
Merge pull request #8592 from open-sausages/pulls/4.0/tree-multiselect-null
FIX TreeMultiselectField passes value 'unchanged' as null to ORM
2018-12-06 14:23:48 +13:00
Guy Marriott
c7b5b1efd2
FIX Switching to use Controller::curr as it was using previously 2018-11-30 15:40:45 +13:00
Guy Marriott
32d096d9e5
DOCS Moving interface subscription to the abstract and adding a changelog entry 2018-11-30 15:40:45 +13:00
Guy Marriott
ddaa22986f
Updating StateStore interface not to define a constructor & fixing GridFieldFilterHeader to add required attributes 2018-11-30 15:40:45 +13:00
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
Robbie Averill
b555bb83b8
Merge pull request #8359 from creative-commoners/pulls/4/HTMLEditorSchema
Add schema information for HTMLEditorField
2018-09-10 09:53:12 +02:00
Robbie Averill
373a8afeb5 Merge branch '4.2' into 4 2018-09-06 13:26:46 +02:00
Robbie Averill
270aba4007 Merge branch '4.1' into 4.2 2018-09-06 13:26:31 +02:00
Robbie Averill
b6ff21f72a Merge branch '4.0' into 4.1 2018-09-06 13:26:13 +02:00
Dylan Wagstaff
f13ee4486d Add schema information for HTMLEditorField
This allows React form builders (or other such view layer builders in a
headless environment) to obtain the details that would otherwise only be
rendered in a PHP side template. Some of the details are critical for
rendering correctly, and are necessary to be passed through -
particularly when moving toward replacing the Entwine initiator for
TinyMCE with a React component in `silverstripe/admin`.

I new interface method has been added to the abstract class for HTML
editor configs in order to facilitate this. It is not itself abstract as
this would break backwards compatiblity with any existing custom config
(aside from the TinyMCE one which we're editing here), which is most
certainly not what we want.
2018-09-06 14:35:11 +12:00
Ingo Schommer
f7d85fe794 Make sure that CMS requests disable caching
Original author: @dhensby

Forward port from 3.7 fix at https://github.com/silverstripe/silverstripe-framework/pull/8318
2018-09-05 11:38:41 +12:00
Maxime Rainville
cc22024e9a ADD New search component for GridFields (#1777) 2018-09-04 11:35:17 +12:00
Robbie Averill
b922c0d732 FIX Check scheme is truthy before setting it to the request 2018-09-03 08:59:37 +02:00
Robbie Averill
2254459310 FIX Text collector translations now compile without errors 2018-09-03 08:21:05 +02:00
Robbie Averill
94f5d32f41
Merge pull request #8351 from open-sausages/pulls/4.2/move-to-your-other-left
BUG Use classes for TinyMCE alignment buttons
2018-08-31 10:18:03 +12:00
Luke Edwards
234b795f89 BUG Use classes for TinyMCE alignment buttons 2018-08-31 09:02:17 +12:00
Guy Marriott
610f17282f
DOCS Updating DataObject config documentation 2018-08-29 14:53:05 +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
Maxime Rainville
dd3379e68f
Merge pull request #8075 from creative-commoners/pulls/4.0/remap-polymorphics
FIX Polymorphic relationship class columns have obsolete class names remapped
2018-08-28 17:03:39 +12:00