Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/3'
Browse files Browse the repository at this point in the history
  • Loading branch information
Damian Mooyman committed Aug 24, 2015
2 parents 58409f6 + 4ea344a commit 958f98b
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 27 deletions.
2 changes: 1 addition & 1 deletion core/Object.php
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ public static function has_extension($classOrExtension, $requiredExtension = nul
* 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')"
*/
Expand Down
1 change: 1 addition & 0 deletions dev/SapphireTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,7 @@ public function loadFixture($fixtureFile) {
* {@link loadFixture()}
*/
public function clearFixtures() {
$this->fixtures = array();
$this->getFixtureFactory()->clear();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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')
));
}

Expand Down
47 changes: 26 additions & 21 deletions docs/en/04_Changelogs/3.2.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,30 +25,14 @@
removes from both draft and live simultaneously.
* Most of the `Image` manipulation methods have been renamed

## Deprecated classes/methods 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.
## Deprecated classes/methods

The following functionality deprecated in 3.0 has been removed:

* `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

Expand Down Expand Up @@ -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),
Expand Down
6 changes: 6 additions & 0 deletions model/DataList.php
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,12 @@ public function getRelationName($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) {
return '"'.$field.'"';
}
Expand Down
4 changes: 0 additions & 4 deletions security/Member.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -120,7 +118,6 @@ class Member extends DataObject implements TemplateGlobalProvider {
'TempIDHash',
'TempIDExpired',
'Salt',
'NumVisit'
);

/**
Expand Down Expand Up @@ -549,7 +546,6 @@ public static function autoLogin() {
$member->RememberLoginToken = $hash;
Cookie::set('alc_enc', $member->ID . ':' . $token, 90, null, null, false, true);

$member->NumVisit++;
$member->write();

// Audit logging hook
Expand Down

0 comments on commit 958f98b

Please sign in to comment.