From 4085b3e654a6ac7367b650479df8ff7684030c7d Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Tue, 12 May 2009 05:29:59 +0000 Subject: [PATCH] BUGFIX Added Money->addToQuery() to work around changes in the ORM which require database columns to be explcitly selected git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@76664 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- core/model/fieldtypes/Money.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/model/fieldtypes/Money.php b/core/model/fieldtypes/Money.php index ce013b9f1..91a88f58b 100644 --- a/core/model/fieldtypes/Money.php +++ b/core/model/fieldtypes/Money.php @@ -85,6 +85,12 @@ class Money extends DBField implements CompositeDBField { $manipulation['fields'][$this->name.'Currency'] = $this->prepValueForDB($this->getCurrency()); $manipulation['fields'][$this->name.'Amount'] = $this->getAmount(); } + + function addToQuery(&$query) { + parent::addToQuery($query); + $query->select[] = $this->name . "Amount"; + $query->select[] = $this->name . "Currency"; + } function setValue($value,$record=null) { if($record && isset($record[$this->name . 'Currency']) && isset($record[$this->name . 'Amount'])) {