Commit Graph

20684 Commits

Author SHA1 Message Date
Ingo Schommer
e415bcb44a Fix tests on unset session data
Thanks Robbie!
2018-07-19 13:32:08 +12:00
Ingo Schommer
93b0884e19 BUG Lazy session state (fixes #8267)
Fixes regression from 3.x, where sessions where lazy started as required:
Either because an existing session identifier was sent through with the request,
or because new session data needed to be persisted as part of the request execution.

Without this lazy starting, *every* request will get a session,
which makes all those responses uncacheable by HTTP layers.

Note that 4.x also changed the $data vs. $changedData payloads:
In 3.x, they both contained key/value pairs.
In 4.x, $data contains key/value, while $changedData contains key/boolean to declare isChanged.
While this reduces duplication in the class, it also surfaced a bug which was latent in 3.x:
When an existing session is lazily resumed via start(), $data is set back to an empty array.
In 3.x, any changed data before this point was *also* retained in $changedData,
ensuring it gets merged into existing $_SESSION data.
In 4.x, this clears out data - hence the need for a more complex merge logic.

Since isset($this->data) is no longer an accurate indicator of a started session,
we introduce a separate $this->started flag.

Note that I've chosen not to make lazy an opt-in (e.g. via start($request, $lazy=false)).
We already have a distinction between lazy starting via init(), and force starting via start().
2018-07-19 13:32:04 +12:00
Daniel Hensby
b83281fa5e
Merge pull request #8265 from gbaumeister/4.2
Added install-requirement-check for php-intl
2018-07-16 17:31:32 +01:00
Daniel Hensby
921b98112e
Merge pull request #8262 from open-sausages/pulls/4/falsifying-tab-evidence
MINOR removeField(s)FromTab no longer creates a tab if it doesn't exist
2018-07-16 17:26:41 +01:00
Gerald Baumeister
df5395b101 Added check for php-intl requirement 2018-07-16 18:08:25 +02:00
Daniel Hensby
5ec5921099
Merge pull request #8264 from DorsetDigital/patch-8
Add use statement to example
2018-07-16 14:49:46 +01:00
DorsetDigital
4b90bb264a
Add use statement to example
Add the relevant 'use' statement to the sample code to remind people that it's needed!
2018-07-16 14:06:28 +01:00
Loz Calver
b317bf163c
Merge pull request #8213 from creative-commoners/pulls/4.2/falsy-forms
FIX FormField::Link works when no form is currently set
2018-07-16 13:53:58 +01:00
Robbie Averill
b93e94c0c3
FIX FormField::Link now throws a LogicException if no form is set yet 2018-07-16 13:02:58 +01:00
Daniel Hensby
1a634f5ba6
Merge pull request #8244 from altwohill/column-not-distinct
Make column query not distinct
2018-07-16 13:01:32 +01:00
Daniel Hensby
89a2ce5d8f
DOCS Add changes to 4.3.0 changelog 2018-07-16 12:16:17 +01:00
Al Twohill
3292a8b773
NEW Add columnUnique API SS_List classes. 2018-07-16 12:16:17 +01:00
Al Twohill
91068c23b5
FIX Make column query not distinct
When selecting a column, it doesn't  make sense to have it distinct.

As an alternative, the API could be changed to give the end user the option
(eg `->column($field, $distinct = false)`)
However if we did that, we would need to make sure we do something
similar with `SilverStripe\ORM\UnsavedRelationList` to ensure consistency.
2018-07-16 11:38:41 +01:00
Loz Calver
106ca6643a
Merge pull request #8263 from dhensby/pulls/4.1/mask-backtrace
FIX updateValidatePassword calls need to be masked from backtraces
2018-07-16 10:30:22 +01:00
Damian Mooyman
c6952b46c4
Merge pull request #8245 from dhensby/pulls/4.2/http-cache-fixes
HTTPCacheControlMiddleware fixes
2018-07-16 13:13:12 +12:00
Robbie Averill
d122995652 FIX Duplicate config values for cascade_duplicates no longer duplicate their duplicates
Previously you could define identical values for this config prop via a DataExtension and on the base
class, resulting in double duplication
2018-07-16 12:04:56 +12:00
Luke Edwards
c8b338b0a3 Add findTab test 2018-07-16 11:59:08 +12:00
Daniel Hensby
8703839eb1
FIX updateValidatePassword calls need to be masked from backtraces 2018-07-15 01:06:45 +01:00
Daniel Hensby
ac5c3416a4
Merge branch '4.2' into 4 2018-07-13 17:06:51 +01:00
Daniel Hensby
bd2abc7a12
Merge branch '4.1' into 4.2 2018-07-13 16:44:23 +01:00
Daniel Hensby
ec9281ee02
Merge branch '4.0' into 4.1 2018-07-13 16:42:00 +01:00
Loz Calver
f0e545ada8
Merge pull request #7971 from dhensby/pulls/4.0/fix-extension-config
FIX Config from extension should not override
2018-07-13 16:15:18 +01:00
Daniel Hensby
d80ef3d9e6
DOCS Update docs to reflect true config merge priorities 2018-07-13 15:43:56 +01:00
Luke Edwards
7ed056ec50 MINOR removeField(s)FromTab no longer creates a tab if it doesn't exist 2018-07-13 14:18:04 +12:00
Luke Edwards
599a4420bf FIX Improve GridFieldViewButton to work with new Archive Admin (#8240)
* Add gridfield restore action, enable view button in action menu

* Abstract restore action and create test

* Use more appropriate canRestoreToDraft and isArchived, move translations

* Use Hierarchy to determine if a record should be restored to root

* Move restore action to versioned
2018-07-13 10:45:13 +12:00
Daniel Hensby
4acec33562
FIX Fixed bug in config merging priorities so that config values set by extensions are now least important instead of most important 2018-07-12 00:55:39 +01:00
Daniel Hensby
28f2ceac6f
TEST Add tests for (im)mutablity of states 2018-07-10 16:58:08 +01:00
Daniel Hensby
fd8448889c
State default should be state enabled (no-cache is an enabled state) 2018-07-10 16:58:08 +01:00
Daniel Hensby
601bb4d768
Make augmentState method more efficient 2018-07-10 16:58:07 +01:00
Daniel Hensby
399ebd0031
FIX If theres a max-age set remove no-cache and no-store 2018-07-10 16:58:07 +01:00
Daniel Hensby
6e00d90783
Merge pull request #8247 from hchokshi/pulls/4/dbcurrency-scaffold-currency-field
Change DBCurrency scaffolded form field to CurrencyField (fixes #8246)
2018-07-10 11:24:27 +01:00
Luke Edwards
3ad000466e
Merge pull request #8248 from open-sausages/pull/4/doc-alternative-upgrader-installation
DOCS Document how to install upgrader as a phar
2018-07-10 16:06:25 +12:00
Maxime Rainville
80b9ca4178
Use permanent url for install phar upgrader
[ci skip]
2018-07-10 13:57:41 +12:00
Harsh Chokshi
6af736a9e1 Change DBCurrency scaffolded form field to CurrencyField (fixes #8246)
Add test ensuring DBCurrency scaffolds CurrencyField
2018-07-09 10:57:01 +12:00
Maxime Rainville
eff2251942 DOCS Document how to install upgrader as a phar
[ci skip]
2018-07-06 12:37:08 +12:00
Ingo Schommer
2e6f29fea0
Merge pull request #8223 from dhensby/pulls/4.0/remove-email-from-pswdrecovery
FIX remove personal information from password reset confirmation screen
2018-07-06 11:27:03 +12:00
Daniel Hensby
92f5ef31d8
FIX Allow setNoCache(false) to remove no-cache directive 2018-07-05 22:51:39 +01:00
Daniel Hensby
18b7dc235a
FIX Add must-revalidate to default state so its common on all our core states 2018-07-05 22:51:03 +01:00
Daniel Hensby
9e829c1607
FIX Allow cache control changes to affect default state 2018-07-05 22:50:35 +01:00
Ingo Schommer
0bd613a3b4
Merge pull request #8233 from dhensby/pulls/4.2/caching-fixes
HTTP Caching fixes :/
2018-07-05 15:11:01 +12:00
Daniel Hensby
560fe9820a FIX remove personal information from password reset confirmation screen 2018-07-05 14:19:15 +12:00
Robbie Averill
e4d1cf8818
Merge pull request #8231 from open-sausages/pulls/4/field-labels-doc-fix
MINOR: DataObject->fieldLabels() will only return an array
2018-07-04 10:56:19 +12:00
Luke Edwards
fbf30ee747 Message reflect previous return type change 2018-07-04 10:55:20 +12:00
Maxime Rainville
3262665b2d Fix link and turn of phrase. 2018-07-03 10:12:59 +12:00
Lukas
cc9b36e011 fix link
@maxime-rainville Link is dead - I think #step1 describes it?
2018-07-03 10:12:59 +12:00
Daniel Hensby
3116b1f97c
Consolidate disabling cache logic 2018-07-02 15:13:46 +01:00
Daniel Hensby
b9b1a74b92
Make config private (notation isnt working) 2018-07-02 13:54:11 +01:00
Daniel Hensby
e4ef83bd2a
FIX Default cache state should be no-cache 2018-07-02 13:33:36 +01:00
Ingo Schommer
85a87ed226
Merge pull request #8200 from open-sausages/pulls/4/versioning-doc-update
Refactoring versioning doc
2018-07-02 15:55:56 +12:00
Ingo Schommer
dd9b8c94a5 DOCS Minor versioned edits
[ci skip]
2018-07-02 15:55:09 +12:00