From 433b883c6b64c77e69f29ee3fe3644377b9946a9 Mon Sep 17 00:00:00 2001 From: Fred Condo Date: Mon, 29 Apr 2013 17:27:27 -0700 Subject: [PATCH 1/4] Use the correct variable as the key into $record It was using $fieldName, which is the CSV field name, not the database field name. This prevents duplicate detection from working. It now properly uses $SQL_fieldName --- dev/CsvBulkLoader.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dev/CsvBulkLoader.php b/dev/CsvBulkLoader.php index 365e1bd22..936ed109e 100644 --- a/dev/CsvBulkLoader.php +++ b/dev/CsvBulkLoader.php @@ -152,11 +152,11 @@ class CsvBulkLoader extends BulkLoader { foreach($this->duplicateChecks as $fieldName => $duplicateCheck) { if(is_string($duplicateCheck)) { $SQL_fieldName = Convert::raw2sql($duplicateCheck); - if(!isset($record[$fieldName])) { + if(!isset($record[$SQL_fieldName])) { return false; //user_error("CsvBulkLoader:processRecord: Couldn't find duplicate identifier '{$fieldName}' in columns", E_USER_ERROR); } - $SQL_fieldValue = Convert::raw2sql($record[$fieldName]); + $SQL_fieldValue = Convert::raw2sql($record[$SQL_fieldName]); $existingRecord = DataObject::get_one($this->objectClass, "\"$SQL_fieldName\" = '{$SQL_fieldValue}'"); if($existingRecord) return $existingRecord; } elseif(is_array($duplicateCheck) && isset($duplicateCheck['callback'])) { From a2394331aff1ad7053aec8df780f92b0e9d8ca51 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Tue, 30 Apr 2013 19:08:50 +0300 Subject: [PATCH 2/4] composer/installer dep workaround Moved to end of requirements, to work around a bug in composer - see https://github.com/composer/composer/issues/1147. This caused the dependencies to be installed in the wrong folder because the custom 'silverstripe-module' instructions hadn't been loaded at the time the core modules were installed via composer. --- composer.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 433cae4f1..851e3198f 100644 --- a/composer.json +++ b/composer.json @@ -17,7 +17,7 @@ ], "require": { "php": ">=5.2.4", - "composer/installers": "*", - "silverstripe/cms": "2.4.*" + "silverstripe/cms": "2.4.*", + "composer/installers": "*" } -} \ No newline at end of file +} From 813749e909e6581ca2502f928c53411ee6b3d14c Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Sun, 12 May 2013 21:25:47 +1200 Subject: [PATCH 3/4] Fixing array to string conversion in dev/build for PHP 5.4 --- core/model/Database.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/core/model/Database.php b/core/model/Database.php index 82dfcb143..f7148e756 100755 --- a/core/model/Database.php +++ b/core/model/Database.php @@ -390,13 +390,14 @@ abstract class SS_Database { } } } - + + $spec_msg = DB::getConn()->convertIndexSpec($spec); + if($newTable || !isset($this->indexList[$table][$index_alt])) { $this->transCreateIndex($table, $index, $spec); - $this->alterationMessage("Index $table.$index: created as $spec","created"); + $this->alterationMessage("Index $table.$index: created as $spec_msg","created"); } else if($array_spec != DB::getConn()->convertIndexSpec($spec)) { $this->transAlterIndex($table, $index, $spec); - $spec_msg=DB::getConn()->convertIndexSpec($spec); $this->alterationMessage("Index $table.$index: changed to $spec_msg (from {$array_spec})","changed"); } } From 5796ed225e0cd48693fc39723c764133f3072f2e Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Fri, 17 May 2013 00:35:28 +0200 Subject: [PATCH 4/4] Updated github path --- README.md | 2 +- docs/en/installation/from-source.md | 6 +++--- docs/en/misc/contributing.md | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 44920ab33..30d9e7230 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,3 @@ # SilverStripe Framework (a.k.a "sapphire") -[![Build Status](https://secure.travis-ci.org/silverstripe/sapphire.png?branch=2.4)](https://travis-ci.org/silverstripe/sapphire) \ No newline at end of file +[![Build Status](https://secure.travis-ci.org/silverstripe/silverstripe-framework.png?branch=2.4)](https://travis-ci.org/silverstripe/silverstripe-framework) \ No newline at end of file diff --git a/docs/en/installation/from-source.md b/docs/en/installation/from-source.md index 38258c7f3..2a41303ad 100644 --- a/docs/en/installation/from-source.md +++ b/docs/en/installation/from-source.md @@ -24,7 +24,7 @@ See [frequently asked questions](/installation/from-source#frequently-asked-ques SilverStripe core is currently hosted on [github.com/silverstripe](http://github.com/silverstripe). The core consists of four parts: * The `installer` project ([github.com/silverstripe/silverstripe-installer](http://github.com/silverstripe/silverstripe-installer)) - * The `sapphire` module ([github.com/silverstripe/sapphire](http://github.com/silverstripe/sapphire)) + * The `sapphire` module ([github.com/silverstripe/silverstripe-framework](http://github.com/silverstripe/silverstripe-framework)) * The `cms` module ([github.com/silverstripe/silverstripe-cms](http://github.com/silverstripe/silverstripe-cms)) * A sample theme called `blackcandy` ([github.com/silverstripe-themes/silverstripe-blackcandy](http://github.com/silverstripe-themes/silverstripe-blackcandy)) @@ -147,7 +147,7 @@ Please replace `` below with your github username. git clone git@github.com:/silverstripe-installer.git my-silverstripe-project cd my-silverstripe-project - git clone git@github.com:/sapphire.git sapphire + git clone git@github.com:/silverstripe-framework.git sapphire git clone git@github.com:/silverstripe-cms.git cms git clone git@github.com:/silverstripe-blackcandy.git themes/blackcandy @@ -155,7 +155,7 @@ Now you need to add the original repository as `upstream`, so you can keep your cd my-silverstripe-project (git remote add upstream git://github.com/silverstripe/silverstripe-installer.git && git fetch upstream) - (cd sapphire && git remote add upstream git://github.com/silverstripe/sapphire.git && git fetch upstream) + (cd sapphire && git remote add upstream git://github.com/silverstripe/silverstripe-framework.git && git fetch upstream) (cd cms && git remote add upstream git://github.com/silverstripe/silverstripe-cms.git && git fetch upstream) (cd themes/blackcandy && git remote add upstream git://github.com/silverstripe-themes/silverstripe-blackcandy.git) diff --git a/docs/en/misc/contributing.md b/docs/en/misc/contributing.md index 595729619..14682887e 100644 --- a/docs/en/misc/contributing.md +++ b/docs/en/misc/contributing.md @@ -64,7 +64,7 @@ Now you have two choices: Smaller fixes (e.g. typos) can be edited directly in t The module authors will get notified automatically, review your patch, and merge it back as appropriate. For new features, we recommend creating a ["feature branch"](http://progit.org/book/ch3-3.html) rather than a really big patch. -On github, you can review outstanding [sapphire pull requests](https://github.com/silverstripe/sapphire/pulls) and [cms pull requests](https://github.com/silverstripe/silverstripe-cms/pulls)). +On github, you can review outstanding [sapphire pull requests](https://github.com/silverstripe/silverstripe-framework/pulls) and [cms pull requests](https://github.com/silverstripe/silverstripe-cms/pulls)). If you want to learn more about git, please have a look at the [free online git book](http://progit.org/book/) and the [git crash course](http://gitref.org/). @@ -160,7 +160,7 @@ Modifying documentation requires basic [PHPDoc](http://en.wikipedia.org/wiki/PHP If you have downloaded SilverStripe or a module, chances are that you already have the documentation files - they are kept alongside the source code (in the `docs/` subfolder). -In general, you have to "[fork](http://help.github.com/forking/)" the [github.com/silverstripe/sapphire](http://github.com/silverstripe/sapphire) +In general, you have to "[fork](http://help.github.com/forking/)" the [github.com/silverstripe/silverstripe-framework](http://github.com/silverstripe/silverstripe-framework) and [github.com/silverstripe/silverstripe-cms](http://github.com/silverstripe/silverstripe-cms) repositories and send us "[pull requests](http://help.github.com/pull-requests/)". Note: Smaller edits can be performed in the github.com web interface on your fork,