mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-09-28 20:29:15 +02:00
Fixed scrutiniser issues
This commit is contained in:
parent
7f057ce343
commit
163917b83e
@ -389,34 +389,44 @@ you can enable those warnings and future-proof your code already.
|
||||
|
||||
### Other
|
||||
|
||||
* `TableListField`, `ComplexTableField`, `TableField`, `HasOneComplexTableField`, `HasManyComplexTableField` and `ManyManyComplexTableField` have been removed from the core and placed into a module called "legacytablefields" located at https://github.com/silverstripe-labs/legacytablefields
|
||||
* `prototype.js` and `behaviour.js` have been removed from the core, they are no longer used. If you have custom code relying on these two libraries, please update your code to include the files yourself
|
||||
* Removed `SiteTree.MetaKeywords` since they are irrelevant in terms of SEO ([seomoz article](http://www.mattcutts.com/blog/keywords-meta-tag-in-web-search/)) and general page informancy
|
||||
* `TableListField`, `ComplexTableField`, `TableField`, `HasOneComplexTableField`, `HasManyComplexTableField`
|
||||
and `ManyManyComplexTableField` have been removed from the core and placed into a module called
|
||||
"legacytablefields" located at https://github.com/silverstripe-labs/legacytablefields
|
||||
* `prototype.js` and `behaviour.js` have been removed from the core, they are no longer used. If you
|
||||
have custom code relying on these two libraries, please update your code to include the files yourself
|
||||
* Removed `SiteTree.MetaKeywords` since they are irrelevant in terms of SEO
|
||||
([seomoz article](http://www.mattcutts.com/blog/keywords-meta-tag-in-web-search/)) and general page informancy
|
||||
* Removed `SiteTree.MetaTitle` as a means to customize the window title, use `SiteTree.Title` instead
|
||||
* Deprecated `Profiler` class, use third-party solutions like [xhprof](https://github.com/facebook/xhprof/)
|
||||
* Removed defunct or unnecessary debug GET parameters:
|
||||
`debug_profile`, `debug_memory`, `profile_trace`, `debug_javascript`, `debug_behaviour`
|
||||
* Removed `Member_ProfileForm`, use `CMSProfileController` instead
|
||||
* `SiteTree::$nested_urls` enabled by default. To disable, call `SiteTree::disable_nested_urls()`.
|
||||
* Removed CMS permission checks from `File->canEdit()` and `File->canDelete()`. If you have unsecured controllers relying on these permissions, please override them through a `DataExtension`.
|
||||
* Moved email bounce handling to new ["emailbouncehandler" module](https://github.com/silverstripe-labs/silverstripe-emailbouncehandler),
|
||||
* Removed CMS permission checks from `File->canEdit()` and `File->canDelete()`. If you have unsecured
|
||||
controllers relying on these permissions, please override them through a `DataExtension`.
|
||||
* Moved email bounce handling to new
|
||||
["emailbouncehandler" module](https://github.com/silverstripe-labs/silverstripe-emailbouncehandler),
|
||||
including `Email_BounceHandler` and `Email_BounceRecord` classes,
|
||||
as well as the `Member->Bounced` property.
|
||||
* Deprecated global email methods `htmlEmail()` and `plaintextEmail`, as well as various email helper methods like `encodeMultipart()`. Use the `Email` API, or the `Mailer` class where applicable.
|
||||
* Deprecated global email methods `htmlEmail()` and `plaintextEmail`, as well as various email helper
|
||||
methods like `encodeMultipart()`. Use the `Email` API, or the `Mailer` class where applicable.
|
||||
* Removed non-functional `$inlineImages` option for sending emails
|
||||
* Removed support for keyed arrays in `SelectionGroup`, use new `SelectionGroup_Item` object
|
||||
to populate the list instead (see [API docs](api:SelectionGroup)).
|
||||
* `FormField->setDescription()` now renders in a `<span class="description">` by default, rather than a `title` attribute * Removed `Form->Name()`: Use getName()
|
||||
* `FormField->setDescription()` now renders in a `<span class="description">` by default, rather
|
||||
than a `title` attribute * Removed `Form->Name()`: Use getName()
|
||||
* Removed `FormField->setContainerFieldSet()`: Use setContainerFieldList()
|
||||
* Removed `FormField->rootFieldSet()`: Use rootFieldList()
|
||||
* Removed `Group::map()`: Use DataList::("Group")->map()
|
||||
* Removed `Member->generateAutologinHash()`: Tokens are no longer saved directly into the database in plaintext. Use the return value of the Member::generateAutologinTokenAndHash to get the token
|
||||
* Removed `Member->generateAutologinHash()`: Tokens are no longer saved directly into the database in
|
||||
plaintext. Use the return value of the Member::generateAutologinTokenAndHash to get the token
|
||||
* Removed `Member->sendInfo()`: use Member_ChangePasswordEmail or Member_ForgotPasswordEmail directly
|
||||
* Removed `SQLMap::map()`: Use DataList::("Member")->map()
|
||||
* Removed `SQLMap::mapInGroups()`: Use Member::map_in_groups()
|
||||
* Removed `PasswordEncryptor::register()/unregister()`: Use config system instead
|
||||
* `UploadField::setConfig()` and `UploadField::getConfig()` are no longer public: Use set{Property} or get{Property} to configure an `UploadField` instance
|
||||
* Methods on DataList and ArrayList that used to both modify the existing list & return a new version now just return a new version. Make sure you change statements like `$list->filter(...)` to $`list = $list->filter(...)` for these methods:
|
||||
* Methods on DataList and ArrayList that used to both modify the existing list & return a new version
|
||||
now just return a new version. Make sure you change statements like `$list->filter(...)` to
|
||||
$`list = $list->filter(...)` for these methods:
|
||||
- `ArrayList#reverse`
|
||||
- `ArrayList#sort`
|
||||
- `ArrayList#filter`
|
||||
@ -431,12 +441,15 @@ you can enable those warnings and future-proof your code already.
|
||||
- `DataList#find`
|
||||
- `DataList#byIDs`
|
||||
- `DataList#reverse`
|
||||
* `DataList#dataQuery` has been changed to return a clone of the query, and so can't be used to modify the list's query directly. Use `DataList#alterDataQuery` instead to modify dataQuery in a safe manner.
|
||||
* `DataList#dataQuery` has been changed to return a clone of the query, and so can't be used to modify the
|
||||
list's query directly. Use `DataList#alterDataQuery` instead to modify dataQuery in a safe manner.
|
||||
* `ScheduledTask`, `QuarterHourlyTask`, `HourlyTask`, `DailyTask`, `MonthlyTask`, `WeeklyTask` and
|
||||
`YearlyTask` are deprecated, please extend from `BuildTask` or `CliController`,
|
||||
and invoke them in self-defined frequencies through Unix cronjobs etc.
|
||||
* `i18n::$common_locales` and `i18n::$common_languages` are now accessed via the Config API, and contain associative rather than indexed arrays.
|
||||
Before: `array('de_DE' => array('German', 'Deutsch'))`, after: `array('de_DE' => array('name' => 'German', 'native' => 'Deutsch'))`.
|
||||
* `i18n::$common_locales` and `i18n::$common_languages` are now accessed via the Config API, and contain
|
||||
associative rather than indexed arrays.
|
||||
Before: `array('de_DE' => array('German', 'Deutsch'))`,
|
||||
After: `array('de_DE' => array('name' => 'German', 'native' => 'Deutsch'))`.
|
||||
* `SSViewer::current_custom_theme()` has been replaced with the `SSViewer.theme_enabled` configuration setting.
|
||||
Please use it to toggle theme behaviour rather than relying on the custom theme being set in the
|
||||
(now deprecated) `SSViewer::set_theme()` call.
|
||||
@ -444,7 +457,8 @@ you can enable those warnings and future-proof your code already.
|
||||
formatting hints as placeholders and description text below the field itself.
|
||||
If you change the date/time format of those fields, you need to adjust the hints.
|
||||
To remove the hints, use `setDescription(null)` and `setAttribute('placeholder', null)`.
|
||||
* Changed the way FreeStrings in `SSTemplateParser` are recognized, they will now also break on inequality operators (`<`, `>`). If you use inequality operators in free strings in comparisions like
|
||||
* Changed the way FreeStrings in `SSTemplateParser` are recognized, they will now also break on inequality
|
||||
operators (`<`, `>`). If you use inequality operators in free strings in comparisions like
|
||||
|
||||
`<% if Some<String == Some>Other>String %>...<% end_if %>`
|
||||
|
||||
|
@ -140,7 +140,8 @@ class UploadFieldTest extends FunctionalTest {
|
||||
|
||||
// Test that the record isn't written to automatically
|
||||
$record = DataObject::get_by_id($record->class, $record->ID, false);
|
||||
$this->assertEquals($relationCount, $record->ManyManyFiles()->Count()); // Existing file count should be retained
|
||||
// Existing file count should be retained
|
||||
$this->assertEquals($relationCount, $record->ManyManyFiles()->Count());
|
||||
|
||||
// Test that saving the form writes the record
|
||||
$ids = array_merge($record->ManyManyFiles()->getIDList(), array($uploadedFile->ID));
|
||||
@ -148,7 +149,8 @@ class UploadFieldTest extends FunctionalTest {
|
||||
$this->assertEmpty($response['errors']);
|
||||
$record = DataObject::get_by_id($record->class, $record->ID, false);
|
||||
$record->flushCache();
|
||||
$this->assertEquals($relationCount + 1, $record->ManyManyFiles()->Count()); // New record should appear here now
|
||||
// New record should appear here now
|
||||
$this->assertEquals($relationCount + 1, $record->ManyManyFiles()->Count());
|
||||
}
|
||||
|
||||
/**
|
||||
@ -186,18 +188,18 @@ class UploadFieldTest extends FunctionalTest {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test that max number of items on has_many is validated
|
||||
*/
|
||||
/**
|
||||
* Test that max number of items on has_many is validated
|
||||
*/
|
||||
public function testAllowedMaxFileNumberWithHasMany() {
|
||||
$this->loginWithPermission('ADMIN');
|
||||
|
||||
|
||||
// The 'HasManyFilesMaxTwo' field has a maximum of two files able to be attached to it.
|
||||
// We want to add files to it until we attempt to add the third. We expect that the first
|
||||
// two should work and the third will fail.
|
||||
$record = $this->objFromFixture('UploadFieldTest_Record', 'record1');
|
||||
$record->HasManyFilesMaxTwo()->removeAll();
|
||||
|
||||
|
||||
// Get references for each file to upload
|
||||
$file1 = $this->objFromFixture('File', 'file1');
|
||||
$file2 = $this->objFromFixture('File', 'file2');
|
||||
@ -206,11 +208,11 @@ class UploadFieldTest extends FunctionalTest {
|
||||
// Write the first element, should be okay.
|
||||
$response = $this->mockUploadFileIDs('HasManyFilesMaxTwo', array($file1->ID));
|
||||
$this->assertEmpty($response['errors']);
|
||||
|
||||
|
||||
// Write the second element, should be okay.
|
||||
$response = $this->mockUploadFileIDs('HasManyFilesMaxTwo', array($file1->ID, $file2->ID));
|
||||
$this->assertEmpty($response['errors']);
|
||||
|
||||
|
||||
// Write the third element, should result in error.
|
||||
$response = $this->mockUploadFileIDs('HasManyFilesMaxTwo', array($file1->ID, $file2->ID, $file3->ID));
|
||||
$this->assertNotEmpty($response['errors']);
|
||||
|
Loading…
Reference in New Issue
Block a user