Merge remote-tracking branch 'origin/3'

This commit is contained in:
Damian Mooyman 2015-08-24 13:08:54 +12:00
commit 958f98b1cf
6 changed files with 34 additions and 26 deletions

View File

@ -441,7 +441,7 @@ abstract class Object {
* instances, not existing ones (including all instances created through {@link singleton()}).
*
* @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
* as a string, e.g. "Versioned" or "Translatable('Param')"
*/

View File

@ -446,6 +446,7 @@ class SapphireTest extends PHPUnit_Framework_TestCase {
* {@link loadFixture()}
*/
public function clearFixtures() {
$this->fixtures = array();
$this->getFixtureFactory()->clear();
}

View File

@ -28,7 +28,7 @@ explicitly logging in or by invoking the "remember me" functionality.
public function updateCMSFields(FieldList $fields) {
$fields->addFieldsToTab('Root.Main', array(
ReadonlyField::create('LastVisited', 'Last visited'),
ReadonlyField::create('NumVisits', 'Number of visits')
ReadonlyField::create('NumVisit', 'Number of visits')
));
}

View File

@ -25,30 +25,14 @@
removes from both draft and live simultaneously.
* 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.
* `SQLMap` removed. Call `map()` on a `DataList` or use `SS_Map` directly instead.
* `Profiler` removed. Use xhprof or xdebug for profiling instead.
* `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.
* `SQLQuery` methods `select()`, `limit()`, `orderby()`, `groupby()`, `having()`, `from()`, `leftjoin()`, `innerjoin()`, `where()` and `whereAny()` removed.
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
@ -199,6 +183,27 @@
## 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
In order to list files in a single folder by default (previous default behaviour),

View File

@ -493,6 +493,12 @@ class DataList extends ViewableData implements SS_List, SS_Filterable, SS_Sortab
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) {
return '"'.$field.'"';
}

View File

@ -12,8 +12,6 @@
* @property string $RememberLoginToken
* @property string $TempIDHash
* @property string $TempIDExpired
* @property int $NumVisit
* @property string $LastVisited Date and time of last visit
* @property string $AutoLoginHash
* @property string $AutoLoginExpired
* @property string $PasswordEncryption
@ -120,7 +118,6 @@ class Member extends DataObject implements TemplateGlobalProvider {
'TempIDHash',
'TempIDExpired',
'Salt',
'NumVisit'
);
/**
@ -549,7 +546,6 @@ class Member extends DataObject implements TemplateGlobalProvider {
$member->RememberLoginToken = $hash;
Cookie::set('alc_enc', $member->ID . ':' . $token, 90, null, null, false, true);
$member->NumVisit++;
$member->write();
// Audit logging hook