From 449cce95a73015a73da3dbdc56d1e8eb6500b72a Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Tue, 4 Dec 2012 14:36:59 +1300 Subject: [PATCH 01/10] Fixing .htaccess to ignore rewriting PHP files directly --- dev/install/install.php5 | 1 + 1 file changed, 1 insertion(+) diff --git a/dev/install/install.php5 b/dev/install/install.php5 index 0b6d9b151..d3ec3783e 100644 --- a/dev/install/install.php5 +++ b/dev/install/install.php5 @@ -1281,6 +1281,7 @@ ErrorDocument 500 /assets/error-500.html $baseClause RewriteCond %{REQUEST_URI} ^(.*)$ RewriteCond %{REQUEST_FILENAME} !-f + RewriteCond %{REQUEST_URI} !\.php$ RewriteRule .* $modulePath/main.php?url=%1&%{QUERY_STRING} [L] TEXT; From c23df511cd0dc0d316489bd443d7256ee28c4226 Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Fri, 14 Dec 2012 12:06:25 +1300 Subject: [PATCH 02/10] Improve class naming and docs for DataList::applyFilterContext() --- model/DataList.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/model/DataList.php b/model/DataList.php index da740e24a..86195c2c2 100644 --- a/model/DataList.php +++ b/model/DataList.php @@ -386,7 +386,7 @@ class DataList extends ViewableData implements SS_List, SS_Filterable, SS_Sortab $fieldArgs = explode(':',$field); $field = array_shift($fieldArgs); foreach($fieldArgs as $fieldArg){ - $comparisor = $this->applyFilterContext($field, $fieldArg, $value); + $this->applyFilterContext($field, $fieldArg, $value); } } else { if($field == 'ID') { @@ -455,23 +455,23 @@ class DataList extends ViewableData implements SS_List, SS_Filterable, SS_Sortab } /** - * Translates the comparisator to the sql query + * Translates a filter type to a SQL query. * * @param string $field - the fieldname in the db - * @param string $comparisators - example StartsWith, relates to a filtercontext + * @param string $filter - a {@link SearchFilter} class, e.g. PartialMatch or StartsWith * @param string $value - the value that the filtercontext will use for matching * @todo Deprecated SearchContexts and pull their functionality into the core of the ORM */ - private function applyFilterContext($field, $comparisators, $value) { + private function applyFilterContext($field, $filter, $value) { $t = singleton($this->dataClass())->dbObject($field); - $className = "{$comparisators}Filter"; - if(!class_exists($className)){ - throw new InvalidArgumentException('There are no '.$comparisators.' comparisator'); + $className = sprintf('%sFilter', $filter); + if(!class_exists($className)) { + throw new InvalidArgumentException(sprintf('Filter class "%s" does not exist', $className)); } - $t = new $className($field,$value); + $t = new $className($field, $value); $t->apply($this->dataQuery()); } - + /** * Return a copy of this list which does not contain any items with these charactaristics * From 3fd176914297da424a9812557697a25e3bf9d28a Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Fri, 21 Dec 2012 14:26:51 +0100 Subject: [PATCH 03/10] Added docs about which branch to choose --- docs/en/installation/composer.md | 7 +++--- docs/en/misc/contributing/code.md | 36 ++++++++++++++++++------------- 2 files changed, 25 insertions(+), 18 deletions(-) diff --git a/docs/en/installation/composer.md b/docs/en/installation/composer.md index c738cc8c6..ed2c947de 100644 --- a/docs/en/installation/composer.md +++ b/docs/en/installation/composer.md @@ -212,7 +212,7 @@ Both the version and the alias are specified as Composer versions, not branch na This is not the only way to set things up in Composer. For more information on this topic, read the ["Aliases" chapter of the Composer documentation](http://getcomposer.org/doc/articles/aliases.md). -## Setting up an environment for contributing to SilverStripe +## Setting up an environment for contributing to SilverStripe {#contributing} So you want to contribute to SilverStripe? Fantastic! You can do this with composer too. You have to tell composer three things in order to be able to do this: @@ -231,8 +231,9 @@ The `--keep-vcs` flag will make sure you have access to the git history of the i The `--dev` flag will add a couple modules which are useful for SilverStripe development: - * The `compass` module will regenerate CSS if you update the SCSS files * The `docsviewer` module will let you preview changes to the project documentation * The `buildtools` module which adds [phing](http://phing.info) tasks for creating SilverStripe releases -Note that you can also include those into an existing project by running `composer update --dev`. \ No newline at end of file +Note that you can also include those into an existing project by running `composer update --dev`. +Please read the ["Contributing Code"](/misc/contributing/code) documentation to find out how to +create forks and send pull requests. \ No newline at end of file diff --git a/docs/en/misc/contributing/code.md b/docs/en/misc/contributing/code.md index c78f8514a..677f1e5a4 100644 --- a/docs/en/misc/contributing/code.md +++ b/docs/en/misc/contributing/code.md @@ -16,29 +16,32 @@ We ask for this so that the ownership in the license is clear and unambiguous, a ## Step-by-step: From forking to sending the pull request - 1. Follow the [Installation for contributions](../../installation/from-source#option-2-installation-for-contributions) instructions, which explain how to fork the core modules and add the correct "upstream" remote. +1. Follow the [Installation through Composer](../../installation/composer#contributing) instructions, +which explain how to fork the core modules and add the correct "upstream" remote. In short: - 1. [Branch for new issue and develop on issue branch](code#branch-for-new-issue-and-develop-on-issue-branch) + composer create-project --keep-vcs --dev silverstripe/installer ./my/website/folder 3.0.x-dev - $ git branch ###-description - $ git checkout ###-description +2. [Branch for new issue and develop on issue branch](code#branch-for-new-issue-and-develop-on-issue-branch) - 1. As time passes, the upstream repository accumulates new commits. Keep your working copy's master branch and issue branch up to date by periodically [rebasing your development branch on the latest upstream](code#rebase-your-development-branch-on-the-latest-upstream). + git branch ###-description + git checkout ###-description - # [make sure all your changes are committed as necessary in branch] - $ git fetch upstream - $ git rebase upstream/master +3. As time passes, the upstream repository accumulates new commits. Keep your working copy's master branch and issue branch up to date by periodically [rebasing your development branch on the latest upstream](code#rebase-your-development-branch-on-the-latest-upstream). - 1. When development is complete, [squash all commit related to a single issue into a single commit](code#squash-all-commits-related-to-a-single-issue-into-a-single-commit). + # [make sure all your changes are committed as necessary in branch] + git fetch upstream + git rebase upstream/master - $ git fetch upstream - $ git rebase -i upstream/master +4. When development is complete, [squash all commit related to a single issue into a single commit](code#squash-all-commits-related-to-a-single-issue-into-a-single-commit). - 1. Push release candidate branch to GitHub + git fetch upstream + git rebase -i upstream/master - $ git push origin ###-description +5. Push release candidate branch to GitHub - 1. Issue pull request on GitHub. Visit your forked respoistory on GitHub.com and click the "Create Pull Request" button nex tot the new branch. + git push origin ###-description + +6. Issue pull request on GitHub. Visit your forked respoistory on GitHub.com and click the "Create Pull Request" button nex tot the new branch. The core team is then responsible for reviewing patches and deciding if they will make it into core. If there are any problems they will follow up with you, so please ensure they have a way to contact you! @@ -61,7 +64,10 @@ If you're familiar with it, here's the short version of what you need to know. O * **Squash your commits, so that each commit addresses a single issue.** After you rebase your work on top of the upstream master, you can squash multiple commits into one. Say, for instance, you've got three commits in related to Issue #100. Squash all three into one with the message "Issue #100 Description of the issue here." We won't accept pull requests for multiple commits related to a single issue; it's up to you to squash and clean your commit tree. (Remember, if you squash commits you've already pushed to GitHub, you won't be able to push that same branch again. Create a new local branch, squash, and push the new squashed branch.) - + * **Choose the correct branch**: Assume the current release is 3.0.3, and 3.1.0 is in beta state. + Most pull requests should go against the `3.1.x-dev` *pre-release branch*, only critical bugfixes + against the `3.0.x-dev` *release branch*. If you're changing an API or introducing a major feature, + the pull request should go against `master` (read more about our [release process](/misc/release-process)). ### Editing files directly on GitHub.com From f431b35b8809805c242a938d29bced507ce37623 Mon Sep 17 00:00:00 2001 From: Justin Martin Date: Tue, 11 Dec 2012 13:57:45 -0800 Subject: [PATCH 04/10] BUG: Confirmed Password Field now copies attributes to child fields. --- forms/ConfirmedPasswordField.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/forms/ConfirmedPasswordField.php b/forms/ConfirmedPasswordField.php index 7f8e9b82c..844e98367 100644 --- a/forms/ConfirmedPasswordField.php +++ b/forms/ConfirmedPasswordField.php @@ -122,6 +122,11 @@ class ConfirmedPasswordField extends FormField { foreach($this->children as $field) { $field->setDisabled($this->isDisabled()); $field->setReadonly($this->isReadonly()); + if(count($this->attributes)) { + foreach($this->attributes as $name => $value) { + $field->setAttribute($name, $value); + } + } $content .= $field->FieldHolder(); } From d872202ae5fb7b689540ecc20ef1754d5aa937c2 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Thu, 3 Jan 2013 20:43:25 +0100 Subject: [PATCH 05/10] Support for X-Reload header Backported from 3.1. Required to get subsite's "copy page to subsite" form submission working. --- admin/javascript/LeftAndMain.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/admin/javascript/LeftAndMain.js b/admin/javascript/LeftAndMain.js index 30db823ce..abbb58c2a 100644 --- a/admin/javascript/LeftAndMain.js +++ b/admin/javascript/LeftAndMain.js @@ -370,6 +370,12 @@ jQuery.noConflict(); handleAjaxResponse: function(data, status, xhr) { var self = this, url, activeTabs, guessFragment; + // Support a full reload + if(xhr.getResponseHeader('X-Reload') && xhr.getResponseHeader('X-ControllerURL')) { + document.location.href = xhr.getResponseHeader('X-ControllerURL'); + return; + } + // Pseudo-redirects via X-ControllerURL might return empty data, in which // case we'll ignore the response if(!data) return; From 5d9819be53472952a404b6272328bf3065b85464 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Fri, 4 Jan 2013 12:21:07 +0100 Subject: [PATCH 06/10] Clearer docs on using composer for contributions --- docs/en/installation/composer.md | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/docs/en/installation/composer.md b/docs/en/installation/composer.md index ed2c947de..b3830d6a1 100644 --- a/docs/en/installation/composer.md +++ b/docs/en/installation/composer.md @@ -44,18 +44,20 @@ Composer can create a new site for you, using the installer as a template. To d composer create-project silverstripe/installer ./my/website/folder -`./my/website/folder` should be the root directory where your site will live. For example, on OS X, you might use a subdirectory of `~/Sites`. - +`./my/website/folder` should be the root directory where your site will live. +For example, on OS X, you might use a subdirectory of `~/Sites`. As long as your web server is up and running, this will get all the code that you need. - Now visit the site in your web browser, and the installation process will be completed. -#### Selecting a version - By default composer will download the latest stable version. You can also specify a version to download that version explicitly, i.e. this will download 3.0.3: composer create-project silverstripe/installer ./my/website/folder 3.0.3 + +When `create-project` is used with a release version like above, +it will try to get the code from archives instead of creating +git repositories. If you're planning to contribute to SilverStripe, +see [Using development versions](#using-development-versions). ## Adding modules to your project @@ -94,14 +96,10 @@ The `composer.lock` file helps with this. It references the specific commits th So, your deployment process, as it relates to Composer, should be as follows: * Run `composer update` on your development version before you start whatever testing you have planned. Perform all the necessary testing. - * Check `composer.lock` into your repository. - * Deploy your project code base, using the deployment tool of your choice. - - * Run the following command on your production version. - - composer install + * Run `composer install` on your production version. + # Advanced usage @@ -236,4 +234,4 @@ The `--dev` flag will add a couple modules which are useful for SilverStripe dev Note that you can also include those into an existing project by running `composer update --dev`. Please read the ["Contributing Code"](/misc/contributing/code) documentation to find out how to -create forks and send pull requests. \ No newline at end of file +create forks and send pull requests. From 9dcace9b324c6c58d99464b87eec99af96777eea Mon Sep 17 00:00:00 2001 From: Nicolaas Date: Sat, 5 Jan 2013 11:26:21 +1300 Subject: [PATCH 07/10] upgrading 'Setting up an environment for contributing to SilverStripe' to heading 1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit we do this to make it clearer that you can do the basic install OR a 'DEV' install - after that we list the advanced usage cases.  --- docs/en/installation/composer.md | 52 ++++++++++++++++---------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/docs/en/installation/composer.md b/docs/en/installation/composer.md index b3830d6a1..f237ff3bb 100644 --- a/docs/en/installation/composer.md +++ b/docs/en/installation/composer.md @@ -99,7 +99,32 @@ So, your deployment process, as it relates to Composer, should be as follows: * Check `composer.lock` into your repository. * Deploy your project code base, using the deployment tool of your choice. * Run `composer install` on your production version. - + +# Setting up an environment for contributing to SilverStripe {#contributing} + +So you want to contribute to SilverStripe? Fantastic! You can do this with composer too. +You have to tell composer three things in order to be able to do this: + + - Keep the full git repository information + - Include dependancies marked as "developer" requirements + - Use the development version, not the latest stable version + +The first two steps are done as part of the initial create project using additional arguments. For instance: + + composer create-project --keep-vcs --dev silverstripe/installer ./my/website/folder 3.0.x-dev + +The process will take a bit longer, since all modules are checked out as full git repositories which you can work on. + +The `--keep-vcs` flag will make sure you have access to the git history of the installer and the requirements + +The `--dev` flag will add a couple modules which are useful for SilverStripe development: + + * The `docsviewer` module will let you preview changes to the project documentation + * The `buildtools` module which adds [phing](http://phing.info) tasks for creating SilverStripe releases + +Note that you can also include those into an existing project by running `composer update --dev`. +Please read the ["Contributing Code"](/misc/contributing/code) documentation to find out how to +create forks and send pull requests. # Advanced usage @@ -210,28 +235,3 @@ Both the version and the alias are specified as Composer versions, not branch na This is not the only way to set things up in Composer. For more information on this topic, read the ["Aliases" chapter of the Composer documentation](http://getcomposer.org/doc/articles/aliases.md). -## Setting up an environment for contributing to SilverStripe {#contributing} - -So you want to contribute to SilverStripe? Fantastic! You can do this with composer too. -You have to tell composer three things in order to be able to do this: - - - Keep the full git repository information - - Include dependancies marked as "developer" requirements - - Use the development version, not the latest stable version - -The first two steps are done as part of the initial create project using additional arguments. For instance: - - composer create-project --keep-vcs --dev silverstripe/installer ./my/website/folder 3.0.x-dev - -The process will take a bit longer, since all modules are checked out as full git repositories which you can work on. - -The `--keep-vcs` flag will make sure you have access to the git history of the installer and the requirements - -The `--dev` flag will add a couple modules which are useful for SilverStripe development: - - * The `docsviewer` module will let you preview changes to the project documentation - * The `buildtools` module which adds [phing](http://phing.info) tasks for creating SilverStripe releases - -Note that you can also include those into an existing project by running `composer update --dev`. -Please read the ["Contributing Code"](/misc/contributing/code) documentation to find out how to -create forks and send pull requests. From 68eb367d2753ccbc8a0ecc9d120b206ec1072ef5 Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Fri, 21 Dec 2012 13:17:01 +1300 Subject: [PATCH 08/10] Remove unncessary variable from TreeDropdownField --- forms/TreeDropdownField.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/forms/TreeDropdownField.php b/forms/TreeDropdownField.php index 3d7874e8f..f32081879 100644 --- a/forms/TreeDropdownField.php +++ b/forms/TreeDropdownField.php @@ -229,8 +229,7 @@ class TreeDropdownField extends FormField { ? (int)$request->latestparam('ID') : (int)$request->requestVar('ID'); - $forceFullTree = $request->requestVar('forceFullTree')?$request->requestVar('forceFullTree'):false; - if($ID && !$forceFullTree) { + if($ID && !$request->requestVar('forceFullTree')) { $obj = DataObject::get_by_id($this->sourceObject, $ID); $isSubTree = true; if(!$obj) { From a8904e3de01be4a99adc48e676f46c65fb0d4061 Mon Sep 17 00:00:00 2001 From: Will Rossiter Date: Tue, 8 Jan 2013 18:17:38 +0800 Subject: [PATCH 09/10] Removed incorrect line from contact form docs. From disqus comments. --- docs/en/howto/simple-contact-form.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/en/howto/simple-contact-form.md b/docs/en/howto/simple-contact-form.md index f785270ff..d29730f2c 100644 --- a/docs/en/howto/simple-contact-form.md +++ b/docs/en/howto/simple-contact-form.md @@ -72,7 +72,6 @@ Now that we have a contact form, we need some way of collecting the data submitt $messageBody = "

Name: {$data['Name']}

-

Website: {$data['Website']}

Message: {$data['Message']}

"; $email->setBody($messageBody); From 001e58c110b9f26c514d42f54b6c4423b38e5f69 Mon Sep 17 00:00:00 2001 From: James Cocker Date: Tue, 8 Jan 2013 15:52:46 +0000 Subject: [PATCH 10/10] Update docs/en/tutorials/1-building-a-basic-site.md Fixed typo in code block. UL tag was opening instead of closing. --- docs/en/tutorials/1-building-a-basic-site.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/tutorials/1-building-a-basic-site.md b/docs/en/tutorials/1-building-a-basic-site.md index 47956fc48..a3e9da444 100644 --- a/docs/en/tutorials/1-building-a-basic-site.md +++ b/docs/en/tutorials/1-building-a-basic-site.md @@ -308,7 +308,7 @@ The following example runs an if statement, and a loop on *Children*, checking t <% end_loop %> -
    +
<% end_if %> <% end_loop %>