mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-09-30 13:19:11 +02:00
Merge remote-tracking branch 'origin/3'
This commit is contained in:
commit
958f98b1cf
@ -441,7 +441,7 @@ abstract class Object {
|
|||||||
* instances, not existing ones (including all instances created through {@link singleton()}).
|
* instances, not existing ones (including all instances created through {@link singleton()}).
|
||||||
*
|
*
|
||||||
* @see http://doc.silverstripe.org/framework/en/trunk/reference/dataextension
|
* @see http://doc.silverstripe.org/framework/en/trunk/reference/dataextension
|
||||||
* @param string $class Class that should be extended - has to be a subclass of {@link Object}
|
* @param string $classOrExtension Class that should be extended - has to be a subclass of {@link Object}
|
||||||
* @param string $extension Subclass of {@link Extension} with optional parameters
|
* @param string $extension Subclass of {@link Extension} with optional parameters
|
||||||
* as a string, e.g. "Versioned" or "Translatable('Param')"
|
* as a string, e.g. "Versioned" or "Translatable('Param')"
|
||||||
*/
|
*/
|
||||||
|
@ -446,6 +446,7 @@ class SapphireTest extends PHPUnit_Framework_TestCase {
|
|||||||
* {@link loadFixture()}
|
* {@link loadFixture()}
|
||||||
*/
|
*/
|
||||||
public function clearFixtures() {
|
public function clearFixtures() {
|
||||||
|
$this->fixtures = array();
|
||||||
$this->getFixtureFactory()->clear();
|
$this->getFixtureFactory()->clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ explicitly logging in or by invoking the "remember me" functionality.
|
|||||||
public function updateCMSFields(FieldList $fields) {
|
public function updateCMSFields(FieldList $fields) {
|
||||||
$fields->addFieldsToTab('Root.Main', array(
|
$fields->addFieldsToTab('Root.Main', array(
|
||||||
ReadonlyField::create('LastVisited', 'Last visited'),
|
ReadonlyField::create('LastVisited', 'Last visited'),
|
||||||
ReadonlyField::create('NumVisits', 'Number of visits')
|
ReadonlyField::create('NumVisit', 'Number of visits')
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,30 +25,14 @@
|
|||||||
removes from both draft and live simultaneously.
|
removes from both draft and live simultaneously.
|
||||||
* Most of the `Image` manipulation methods have been renamed
|
* Most of the `Image` manipulation methods have been renamed
|
||||||
|
|
||||||
## Deprecated classes/methods removed
|
## Deprecated classes/methods
|
||||||
|
|
||||||
|
The following functionality deprecated in 3.0 has been removed:
|
||||||
|
|
||||||
* `ToggleField` was deprecated in 3.1, and has been removed. Use custom Javascript with `ReadonlyField` instead.
|
|
||||||
* `ExactMatchMultiFilter` was deprecated in 3.1, and has been removed. Use `ExactMatchFilter` instead.
|
|
||||||
* `NegationFilter` was deprecated in 3.1, and has been removed. Use `ExactMatchFilter:not` instead.
|
|
||||||
* `StartsWithMultiFilter` was deprecated in 3.1, and has been removed. Use `StartsWithFilter` instead.
|
|
||||||
* `ScheduledTask` and subclasses like `DailyTask` were deprecated in 3.1, and have been removed.
|
|
||||||
Use custom code instead, or a module like silverstripe-crontask: https://github.com/silverstripe-labs/silverstripe-crontask
|
|
||||||
* `Cookie::forceExpiry()` was removed. Use `Cookie::force_expiry()` instead
|
|
||||||
* `Object` statics removal: `get_static()`, `set_static()`, `uninherited_static()`, `combined_static()`,
|
|
||||||
`addStaticVars()` and `add_static_var()` removed. Use the Config methods instead.
|
|
||||||
* `GD` methods removed: `setGD()`, `getGD()`, `hasGD()`. Use `setImageResource()`, `getImageResource()`, and `hasImageResource()` instead
|
|
||||||
* `DataExtension::get_extra_config()` removed, no longer supports `extraStatics` or `extraDBFields`. Define your
|
|
||||||
statics on the class directly.
|
|
||||||
* `DataList::getRange()` removed. Use `limit()` instead.
|
* `DataList::getRange()` removed. Use `limit()` instead.
|
||||||
* `SQLMap` removed. Call `map()` on a `DataList` or use `SS_Map` directly instead.
|
* `SQLMap` removed. Call `map()` on a `DataList` or use `SS_Map` directly instead.
|
||||||
* `Profiler` removed. Use xhprof or xdebug for profiling instead.
|
* `SQLQuery` methods `select()`, `limit()`, `orderby()`, `groupby()`, `having()`, `from()`, `leftjoin()`, `innerjoin()`, `where()` and `whereAny()` removed.
|
||||||
* `Aggregate` removed. Call aggregate methods on a `DataList` instead e.g. `Member::get()->max('LastEdited')`
|
|
||||||
* `MySQLDatabase::set_connection_charset()` removed. Use `MySQLDatabase.connection_charset` config setting instead
|
|
||||||
* `SQLConditionalExpression/SQLQuery` `select()`, `limit()`, `orderby()`, `groupby()`, `having()`, `from()`, `leftjoin()`, `innerjoin()`, `where()` and `whereAny()` removed.
|
|
||||||
Use `set*()` and `add*()` methods instead.
|
Use `set*()` and `add*()` methods instead.
|
||||||
* Template `<% control $MyList %>` syntax removed. Use `<% loop $MyList %>` instead.
|
|
||||||
* Removed `Member.LastVisited` and `Member.NumVisits` properties, see
|
|
||||||
[Howto: Track Member Logins](/extending/how_tos/track_member_logins) to restore functionality as custom code
|
|
||||||
|
|
||||||
## New and changed API
|
## New and changed API
|
||||||
|
|
||||||
@ -199,6 +183,27 @@
|
|||||||
|
|
||||||
## Upgrading Notes
|
## Upgrading Notes
|
||||||
|
|
||||||
|
### Disable `LastVisited` and `NumVisits` counter
|
||||||
|
|
||||||
|
These fields were deprecated in 3.1 due to performance concerns, and should be disabled unless required by
|
||||||
|
your application.
|
||||||
|
|
||||||
|
In order to disable these functions you can add the following yml to your configuration:
|
||||||
|
|
||||||
|
:::yaml
|
||||||
|
---
|
||||||
|
Name: disablevisits
|
||||||
|
---
|
||||||
|
Member:
|
||||||
|
log_num_visits: false
|
||||||
|
log_last_visited: false
|
||||||
|
|
||||||
|
|
||||||
|
This functionality will be removed in 4.0
|
||||||
|
|
||||||
|
[Howto: Track Member Logins](/developer-guides/extending/how_tos/track_member_logins) to restore functionality
|
||||||
|
as custom code
|
||||||
|
|
||||||
### UploadField "Select from files" shows files in all folders by default
|
### UploadField "Select from files" shows files in all folders by default
|
||||||
|
|
||||||
In order to list files in a single folder by default (previous default behaviour),
|
In order to list files in a single folder by default (previous default behaviour),
|
||||||
|
@ -493,6 +493,12 @@ class DataList extends ViewableData implements SS_List, SS_Filterable, SS_Sortab
|
|||||||
throw new InvalidArgumentException("Bad field expression $field");
|
throw new InvalidArgumentException("Bad field expression $field");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!$this->inAlterDataQueryCall) {
|
||||||
|
throw new BadMethodCallException(
|
||||||
|
'getRelationName is mutating, and must be called inside an alterDataQuery block'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
if(strpos($field,'.') === false) {
|
if(strpos($field,'.') === false) {
|
||||||
return '"'.$field.'"';
|
return '"'.$field.'"';
|
||||||
}
|
}
|
||||||
|
@ -12,8 +12,6 @@
|
|||||||
* @property string $RememberLoginToken
|
* @property string $RememberLoginToken
|
||||||
* @property string $TempIDHash
|
* @property string $TempIDHash
|
||||||
* @property string $TempIDExpired
|
* @property string $TempIDExpired
|
||||||
* @property int $NumVisit
|
|
||||||
* @property string $LastVisited Date and time of last visit
|
|
||||||
* @property string $AutoLoginHash
|
* @property string $AutoLoginHash
|
||||||
* @property string $AutoLoginExpired
|
* @property string $AutoLoginExpired
|
||||||
* @property string $PasswordEncryption
|
* @property string $PasswordEncryption
|
||||||
@ -120,7 +118,6 @@ class Member extends DataObject implements TemplateGlobalProvider {
|
|||||||
'TempIDHash',
|
'TempIDHash',
|
||||||
'TempIDExpired',
|
'TempIDExpired',
|
||||||
'Salt',
|
'Salt',
|
||||||
'NumVisit'
|
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -549,7 +546,6 @@ class Member extends DataObject implements TemplateGlobalProvider {
|
|||||||
$member->RememberLoginToken = $hash;
|
$member->RememberLoginToken = $hash;
|
||||||
Cookie::set('alc_enc', $member->ID . ':' . $token, 90, null, null, false, true);
|
Cookie::set('alc_enc', $member->ID . ':' . $token, 90, null, null, false, true);
|
||||||
|
|
||||||
$member->NumVisit++;
|
|
||||||
$member->write();
|
$member->write();
|
||||||
|
|
||||||
// Audit logging hook
|
// Audit logging hook
|
||||||
|
Loading…
Reference in New Issue
Block a user