Commit Graph

1236 Commits

Author SHA1 Message Date
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
Robbie Averill
d651d0fbfc FIX Use base class (not remapping target class) when looking up whether object is versioned 2018-08-28 14:15:02 +12:00
Maxime Rainville
e8261589e8
Merge pull request #8304 from micmania1/patch-12
BUGFIX Installer redirect to home/ (without domain)
2018-08-28 13:47:24 +12:00
Robbie Averill
83e461abbf Merge branch '4.2' into 4 2018-08-27 16:15:57 +12:00
Robbie Averill
37a266f2f0 Merge branch '4.1' into 4.2 2018-08-27 16:14:24 +12:00
Scott Hutchinson
4da5569232 FIX ensure createFromVariables takes correct params on CLIRequestBuilder 2018-08-27 16:12:52 +12:00
Robbie Averill
66c09afc9c Merge branch '4.0' into 4.1 2018-08-27 16:12:04 +12:00
Robbie Averill
3178fbf3bb
Merge pull request #8028 from andrewandante/pulls/4.0/unset_http_scheme_on_cli
unset http scheme on CLIRequestBuilder
2018-08-27 16:11:42 +12:00
Robbie Averill
a87165c299
Merge pull request #8326 from creative-commoners/pulls/4.2/remove-double-encoding
FIX Remove double escaping of HTML values in print views
2018-08-27 13:37:32 +12:00
Luke Edwards
6164d01d65 FIX GridField delete button to offer archive action if possible (#8325)
* FIX GridField delete button to offer archive action if possible

* Refactor archive action to versioned module

* Fix GridFieldDeleteAction test
2018-08-24 13:13:32 +12:00
Robbie Averill
050afd79c1
Merge pull request #8316 from anhld/anhld-patch-1
Password changing notification issue on new member
2018-08-23 14:03:17 +12:00
Thomas Portelange
27ac001d5b FIX email rendering should not include requirements
If no body is defined, the email is rendered according to a template. Clearing requirements prevent unnecessary styles/scripts to be included in the html (and that needs to be processed/stripped down the line).
2018-08-23 14:01:27 +12:00
Robbie Averill
373326e49c
Merge pull request #8324 from creative-commoners/pulls/4.2/request-before-init
FIX Pass request to dummy controller before calling init
2018-08-21 12:08:14 +12:00
Daniel Hensby
aa153cb5c7
Merge pull request #8315 from open-sausages/pulls/4.2/changing-change
FIX Paginating a gridfield causing a change event
2018-08-20 17:59:50 +01:00
Robbie Averill
18fff5c16c Remove past tense for "log in" in expired token message 2018-08-20 22:31:23 +12:00
Robbie Averill
dbab696690 FIX Message when changing password with invalid token now contains correct links to login
The Security controller should be used to return these links rather than the
ChangePasswordHandler
2018-08-20 22:30:12 +12:00
Robbie Averill
735c87b709
Merge pull request #8327 from dhensby/pulls/4/application-json
FIX text/json is not a valid mimetype
2018-08-19 13:42:27 +12:00
maks
160d595e22
fix trailing whitespace 2018-08-17 18:16:17 +02:00
maks
16217f3655
fix accidentaly deleted comma 2018-08-17 15:13:13 +02:00
maks
aa1e576a3f
convert to php 5.4+ array syntax 2018-08-17 15:03:46 +02:00
Luke Edwards
9f5b0086cb FIX Paginating a gridfield causing a change event 2018-08-17 09:35:57 +12:00
Daniel Hensby
d9154bffbf
FIX text/json is not a valid mimetype 2018-08-15 12:10:39 +01:00
Robbie Averill
0db594b2d3 FIX Remove double escaping of HTML values in print views
Print view uses the SilverStripe templating to render values which means that
values are safely escaped by default. This can be tested by chaing `$CellString`
to `$CellString.RAW` in the GridField_print.ss template to see this escaping
being disabled.

This pull request removes double escaping of HTML in strings.
2018-08-15 17:57:40 +12:00
Robbie Averill
953153500d FIX Polymorphic relationship class columns have obsolete class names remapped 2018-08-15 10:40:51 +12:00
Robbie Averill
873873dc30 FIX Pass request to dummy controller before calling init 2018-08-15 10:14:25 +12:00
Anh Le
68f75a9e25
Password changing notification issue on new member
With `notify_password_change = true`, new member is receiving notification email regarding password changing when they should not.
2018-08-13 14:13:05 +07:00
Michael Strong
13372f9a37
BUGFIX Installer redirect to home/ (without domain)
This fixes a bug where the installer redirects to home/ ('home' as the domain) as the url as opposed to localhost/home.

To reproduce:
* Use chrome (untested in other browsers)
* composer create project silverstripe/installer
* Run through the installer

Expected:
* Silverstripe installs and it takes you to the success page

Actual:
* SilverStripe installs and takes you to a different domain (ie. 'http://home')

The problem seems to be, any URL starting with `//` (two slashes) is normalised by the browser to an absolute URL by removing both slashes meaning `//home` becomes just `home` (as in http://home)
2018-08-06 14:48:23 +12:00
Ingo Schommer
2d6964c243
Merge pull request #8261 from open-sausages/pulls/4/secure-remember-me-cookie
NEW Option for secure "remember me" cookie
2018-07-31 09:19:15 +12:00
Daniel Hensby
4d83330981
Merge branch '4.2' into 4 2018-07-30 17:11:42 +01:00
Daniel Hensby
17dbb86257
Merge pull request #8293 from open-sausages/pulls/4.2/restore-default-delete-action-of-record-editor
FIX Restore default delete action on GridFieldConfig_RecordEditor
2018-07-30 17:00:09 +01:00
Ingo Schommer
114b0a5ea7
NEW Option for secure "remember me" cookie
Fixes #8234
2018-07-30 16:41:49 +01:00