Skip to content

Commit

Permalink
Merge branch '4'
Browse files Browse the repository at this point in the history
  # Conflicts:
  #	.travis.yml
  #	src/Core/Extensible.php
  #	src/ORM/ArrayList.php
  #	src/ORM/Connect/DBSchemaManager.php
  #	src/ORM/ManyManyList.php
  #	tests/php/Control/ControllerTest.php
  #	tests/php/Control/RequestHandlingTest.php
  • Loading branch information
robbieaverill committed Oct 3, 2018
2 parents bad1ac7 + ee24413 commit 1cdfe7f
Show file tree
Hide file tree
Showing 97 changed files with 1,485 additions and 595 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -1,3 +1,4 @@
/assets/
.sass-cache
.DS_Store
npm-debug.log
Expand Down
22 changes: 14 additions & 8 deletions .travis.yml
Expand Up @@ -23,36 +23,43 @@ matrix:
- DB=MYSQL
- PHPCS_TEST=1
- PHPUNIT_TEST=framework

- php: 7.1
env:
- DB=PGSQL
- PHPUNIT_TEST=framework

- php: 7.1
if: type IN (cron)
env:
- DB=MYSQL
- PDO=1
- PHPUNIT_COVERAGE_TEST=framework

- php: 7.2
env:
- DB=MYSQL
- PDO=1
- PHPUNIT_TEST=framework
- php: nightly
env:
- DB=MYSQL
- PDO=1
- PHPUNIT_TEST=framework

- php: 7.1
env:
- DB=MYSQL
- PHPUNIT_TEST=cms
allow_failures:
- php: nightly

- php: 7.3.0RC1
env:
- DB=MYSQL
- PDO=1
- PHPUNIT_TEST=framework
sudo: required
dist: xenial
addons:
apt:
packages:
- libzip4
services:
- mysql

before_script:
# Extra $PATH
Expand All @@ -77,7 +84,6 @@ before_script:
# Log constants to CI for debugging purposes
- php ./tests/dump_constants.php


script:
- if [[ $PHPUNIT_TEST ]]; then vendor/bin/phpunit --testsuite $PHPUNIT_TEST; fi
- if [[ $PHPUNIT_COVERAGE_TEST ]]; then phpdbg -qrr vendor/bin/phpunit --testsuite $PHPUNIT_COVERAGE_TEST --coverage-clover=coverage.xml; fi
Expand Down
1 change: 0 additions & 1 deletion docs/en/00_Getting_Started/03_Environment_Management.md
Expand Up @@ -94,7 +94,6 @@ SilverStripe core environment variables are listed here, though you're free to d
| `SS_MANIFESTCACHE` | The manifest cache to use (defaults to file based caching). Must be a CacheInterface or CacheFactory class name |
| `SS_IGNORE_DOT_ENV` | If set the .env file will be ignored. This is good for live to mitigate any performance implications of loading the .env file |
| `SS_BASE_URL` | The url to use when it isn't determinable by other means (eg: for CLI commands) |
| `SS_CONFIGSTATICMANIFEST` | Set to `SS_ConfigStaticManifest_Reflection` to use the Silverstripe 4 Reflection config manifest (speed improvement during dev/build and ?flush) |
| `SS_DATABASE_SSL_KEY` | Absolute path to SSL key file |
| `SS_DATABASE_SSL_CERT` | Absolute path to SSL certificate file |
| `SS_DATABASE_SSL_CA` | Absolute path to SSL Certificate Authority bundle file |
Expand Down
8 changes: 8 additions & 0 deletions docs/en/02_Developer_Guides/00_Model/02_Relations.md
Expand Up @@ -594,6 +594,13 @@ As these lists are not backed by the database, most of the filtering methods on
this type. As such, an `UnsavedRelationList` should only be used for setting a relation before saving an object, not
for displaying the objects contained in the relation.

## Link Tracking

You can control the visibility of the `Link Tracking` tab by setting the `show_sitetree_link_tracking` config.
This defaults to `false` for most `DataObject`'s.

It is also possible to control the visibility of the `File Tracking` tab by setting the `show_file_link_tracking` config.

## Related Lessons
* [Working with data relationships -- has_many](https://www.silverstripe.org/learn/lessons/v4/working-with-data-relationships-has-many-1)
* [Working with data relationships -- many_many](https://www.silverstripe.org/learn/lessons/v4/working-with-data-relationships-many-many-1)
Expand All @@ -608,3 +615,4 @@ for displaying the objects contained in the relation.
* [HasManyList](api:SilverStripe\ORM\HasManyList)
* [ManyManyList](api:SilverStripe\ORM\ManyManyList)
* [DataObject](api:SilverStripe\ORM\DataObject)
* [LinkTracking](api:SilverStripe\CMS\Model\SiteTreeLinkTracking)
4 changes: 2 additions & 2 deletions docs/en/02_Developer_Guides/01_Templates/01_Syntax.md
Expand Up @@ -569,11 +569,11 @@ $EditForm <%-- Some hidden comment about the form --%>

## Related Documentation

[CHILDREN]
[CHILDREN Exclude="How_Tos"]

## How to's

[CHILDREN How_Tos]
[CHILDREN Folder="How_Tos"]

## API Documentation

Expand Down
Expand Up @@ -135,7 +135,7 @@ SilverStripe\View\SSViewer:

### Declaring module priority

The order in which templates are selected from themes can be explicitly declared
The order in which templates are selected from modules can be explicitly declared
through configuration. To specify the order you want, make a list of the module
names under `SilverStripe\Core\Manifest\ModuleManifest.module_priority` in a
configuration YAML file.
Expand Down Expand Up @@ -168,7 +168,7 @@ to find out how to rename this folder.

### About module "names"

Module names are derived their local `composer.json` files using the following precedence:
Module names are derived from their local `composer.json` files using the following precedence:
* The value of the `name` attribute in `composer.json`
* The value of `extras.installer_name` in `composer.json`
* The basename of the directory that contains the module
Expand Down
Expand Up @@ -169,7 +169,7 @@ as well as give other features in SilverStripe the ability to influence link beh
public function Link($action = null)
{
// Construct link with graceful handling of GET parameters
$link = Controller::join_links('teams', $ction);
$link = Controller::join_links('teams', $action);

// Allow Versioned and other extension to update $link by reference.
$this->extend('updateLink', $link, $action);
Expand Down
10 changes: 5 additions & 5 deletions docs/en/02_Developer_Guides/05_Extending/01_Extensions.md
Expand Up @@ -3,15 +3,15 @@ summary: Extensions and DataExtensions let you modify and augment objects transp

# Extensions and DataExtensions

An [Extension](api:SilverStripe\Core\Extension) allows for adding additional functionality to a [Object](api:Object) or modifying existing functionality
without the hassle of creating a subclass. Developers can add Extensions to any [Object](api:Object) subclass within core, modules
or even their own code to make it more reusable.
An [Extension](api:SilverStripe\Core\Extension) allows for adding additional functionality to a class or modifying existing functionality
without the hassle of creating a subclass. Developers can add Extensions to any PHP class that has the [Extensible](api:SilverStripe\Core\Extensible)
trait applied within core, modules or even their own code to make it more reusable.

Extensions are defined as subclasses of either [DataExtension](api:SilverStripe\ORM\DataExtension) for extending a [DataObject](api:SilverStripe\ORM\DataObject) subclass or
the [Extension](api:SilverStripe\Core\Extension) class for non DataObject subclasses (such as [Controller](api:SilverStripe\Control\Controller))

<div class="info" markdown="1">
For performance reasons a few classes are excluded from receiving extensions, including `Object`, `ViewableData`
For performance reasons a few classes are excluded from receiving extensions, including `ViewableData`
and `RequestHandler`. You can still apply extensions to descendants of these classes.
</div>

Expand All @@ -25,7 +25,7 @@ class MyMemberExtension extends DataExtension
{

private static $db = [
'DateOfBirth' => 'SS_Datetime'
'DateOfBirth' => 'DBDatetime'
];

public function SayHi()
Expand Down
Expand Up @@ -20,7 +20,7 @@ use SilverStripe\View\Parsers\ShortcodeParser;

ShortcodeParser::get('default')->register('googlemap', function($arguments, $address, $parser, $shortcode) {
$iframeUrl = sprintf(
'http://maps.google.com/maps?q=%s&amp;hnear=%s&amp;ie=UTF8&hq=&amp;t=m&amp;z=14&amp;output=embed',
'//maps.google.com/maps?q=%s&amp;hnear=%s&amp;ie=UTF8&hq=&amp;t=m&amp;z=14&amp;output=embed',
urlencode($address),
urlencode($address)
);
Expand Down
2 changes: 1 addition & 1 deletion docs/en/02_Developer_Guides/06_Testing/index.md
Expand Up @@ -31,7 +31,7 @@ Tests are run from the commandline, in your webroot folder:
* `vendor/bin/phpunit vendor/silverstripe/framework/tests/`: Run all tests of a specific module
* `vendor/bin/phpunit vendor/silverstripe/framework/tests/filesystem`: Run specific tests within a specific module
* `vendor/bin/phpunit vendor/silverstripe/framework/tests/filesystem/FolderTest.php`: Run a specific test
* `vendor/bin/phpunit vendor/silverstripe/framework/tests '' flush=all`: Run tests with optional request parameters (note the empty second argument)
* `vendor/bin/phpunit vendor/silverstripe/framework/tests '' flush=1`: Run tests with optional request parameters (note the empty second argument)

Check the PHPUnit manual for all available [command line arguments](http://www.phpunit.de/manual/current/en/textui.html).

Expand Down
Expand Up @@ -39,6 +39,7 @@ session variables, used templates and much more.
| URL Variable | | Values | | Description |
| ------------ | | --------- | | ----------- |
| showqueries | | 1&vert;inline | | List all SQL queries executed, the `inline` option will do a fudge replacement of parameterised queries |
| showqueries | | 1&vert;backtrace | | List all SQL queries executed, the `backtrace` option will do a fudge replacement of parameterised queries *and* show a backtrace of every query |
| previewwrite | | 1 | | List all insert / update SQL queries, and **don't** execute them. Useful for previewing writes to the database. |

## Security Redirects
Expand Down
Expand Up @@ -63,13 +63,13 @@ otherwise. By using aggregates, we do that like this:


```ss
<% cached 'navigation', $List('SiteTree').max('LastEdited'), $List('SiteTree').count() %>
<% cached 'navigation', $List('SilverStripe\CMS\Model\SiteTree').max('LastEdited'), $List('SilverStripe\CMS\Model\SiteTree').count() %>
```

The cache for this will update whenever a page is added, removed or edited.
The cache for this will update whenever a page is added, removed or edited. (Note: The use of the fully qualified classname is necessary).

If we have a block that shows a list of categories, we can make sure the cache updates every time a category is added
or edited
or edited:


```ss
Expand Down
Expand Up @@ -17,7 +17,7 @@ const HideableComponent = ({Component, ...props}) => (
);

HideableComponent.propTypes = {
shouldHide: React.PropTypes.boolean
shouldHide: PropTypes.boolean
};

HideableComponent.defaultProps = {
Expand Down
1 change: 1 addition & 0 deletions docs/en/03_Upgrading/index.md
Expand Up @@ -131,6 +131,7 @@ composer global config bin-dir
On *nix system, the following command will add your global composer bin directory to your path if `bash` is your default shell environment:
```bash
echo 'export PATH=$PATH:~/.composer/vendor/bin/' >> ~/.bash_profile
source ~/.bash_profile
```

### Running all the upgrader commands in this guide in on line
Expand Down
1 change: 1 addition & 0 deletions docs/en/04_Changelogs/4.3.0.md
Expand Up @@ -4,6 +4,7 @@

- `DataList::column()` now returns all values and not just "distinct" values from a column as per the API docs
- `DataList`, `ArrayList` and `UnsavedRalationList` all have `columnUnique()` method for fetching distinct column values
- Take care with `stageChildren()` overrides. `Hierarchy::numChildren() ` results will only make use of `stageChildren()` customisations that are applied to the base class and don't include record-specific behaviour.

## Upgrading {#upgrading}

Expand Down
45 changes: 15 additions & 30 deletions docs/en/05_Contributing/01_Code.md
Expand Up @@ -76,34 +76,15 @@ there are any problems they will follow up with you, so please ensure they have

### Picking the right version

SilverStripe core and module releases (since the 3.1.8 release) follow the [Semantic Versioning](http://semver.org)
(SemVer) specification for releases. Using this specification declares to the entire development community the severity
and intention of each release. It gives developers the ability to safely declare their dependencies and understand the
scope involved in each upgrade.
The SilverStripe project follows the [Semantic Versioning](http://semver.org) (SemVer) specification for releases.
It clarifies what to expect from different releases, and also guides you in choosing the right branch
to base your pull request on. In short, most pull requests should be based on the "default branch"
which gets automatically chosen when creating a new pull request. This ensures your code
gets into the next minor release of the current major release.

Each release is labeled in the format `$MAJOR`.`$MINOR`.`$PATCH`. For example, 3.1.8 or 3.2.0.

* `$MAJOR` version is incremented if any backwards incompatible changes are introduced to the public API.
* `$MINOR` version is incremented if new, backwards compatible **functionality** is introduced to the public API or
improvements are introduced within the private code.
* `$PATCH` version is incremented if only backwards compatible **bug fixes** are introduced. A bug fix is defined as
an internal change that fixes incorrect behavior.

**Public API** refers to any aspect of the system that has been designed to be used by SilverStripe modules & site developers. In SilverStripe 3, because we haven't been clear, in principle we have to treat every public or protected method as *potentially* part of the public API, but sometimes it comes to a judgement call about how likely it is that a given method will have been used in a particular way. If we were strict about never changing publicly exposed behaviour, it would be difficult to fix any bug whatsoever, which isn't in the interests of our user community.

In future major releases of SilverStripe, we will endeavour to be more explicit about documenting the public API.

**Contributing bug fixes**

Bug fixes should be raised against the most recent MINOR release branch. For example, If your project is on 3.3.1 and 3.4.0 is released, please raise your bugfix against the `3.4` branch. Older MINOR release branches are primarily intended for critical bugfixes and security issues.

**Contributing features**

When contributing a backwards compatible change, raise it against the same MAJOR branch as your project. For example, if your project is on 3.3.1, raise it against the `3` branch. It will be included in the next MINOR release, e.g. 3.4.0. And then when it is released, you should upgrade your project to use it. As it is a MINOR change, it shouldn't break anything, and be a relatively painless upgrade.

**Contributing backwards-incompatible public API changes, and removing or radically changing existing feautres**

When contributing a backwards incompatible change, you must raise it against the `master` branch.
If you are changing existing APIs, introducing new APIs or major new features,
please review our guidance on [supported versions](release-process#supported-versions).
You will need to change the branch for your pull request accordingly.


### The Pull Request Process
Expand Down Expand Up @@ -131,17 +112,21 @@ The current GitHub labels are grouped into five sections:
| change/major | A change for the next major release (eg: 4.0) |
| change/minor | A change for the next minor release (eg: 3.x) |
| change/patch | A change for the next patch release (eg: 3.1.x) |
| impact/critical | Broken functionality for which no work around can be produced |
| impact/high | Broken functionality but can be mitigated by other non-core code changes |
| impact/medium | Unexpected behaviour but does not break functionality |
| impact/critical | Broken functionality without workarounds, affecting major usage flows. Should target all [supported minor releases](release-process#supported-versions) |
| impact/high | Broken functionality with workarounds available, affecting major usage flows |
| impact/medium | Unexpected behaviour, or broken functionality on less common usage flows |
| impact/low | A nuisance but doesn't break any functionality (typos, etc) |
| effort/easy | Someone with limited SilverStripe experience could resolve |
| effort/medium | Someone with a good understanding of SilverStripe could resolve |
| effort/hard | Only an expert with SilverStripe could resolve |
| type/docs | A docs change |
| type/frontend | A change to front-end (CSS, HTML, etc) |
| type/ux | User experience impact |
| feedback-required/core-team | Core team members need to give an in-depth consideration |
| feedback-required/author | This issue is awaiting feedback from the original author of the PR |
| rfc/draft | [RFC](request-for-comment) under discussion |
| rfc/accepted | [RFC](request-for-comment) where agreement has been reached |
| affects/* | Issue has been observed on a specific release line |

### Quickfire Do's and Don't's

Expand Down

0 comments on commit 1cdfe7f

Please sign in to comment.