From d838529953fd56b7847e1e1e2e36f8f5f7599089 Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Mon, 3 Aug 2009 21:34:19 +0000 Subject: [PATCH] BUGFIX Object subclasses with a constructor that didn't already will now call parent to respect inheritance git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@83587 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- api/RSSFeed.php | 4 ++++ api/RestfulService.php | 1 + core/TokenisedRegularExpression.php | 1 + core/ValidationResult.php | 1 + core/model/DataDifferencer.php | 1 + core/model/YamlFixture.php | 1 + dev/CSSContentParser.php | 4 ++-- dev/CSVParser.php | 1 + dev/ModelViewer.php | 1 + email/Email.php | 1 + forms/FormScaffolder.php | 1 + forms/ReportField.php | 1 + 12 files changed, 16 insertions(+), 2 deletions(-) diff --git a/api/RSSFeed.php b/api/RSSFeed.php index 73a88396e..a5d23eba9 100755 --- a/api/RSSFeed.php +++ b/api/RSSFeed.php @@ -114,6 +114,8 @@ class RSSFeed extends ViewableData { $this->lastModified = $lastModified; $this->etag = $etag; + + parent::__construct(); } /** @@ -245,6 +247,8 @@ class RSSFeed_Entry extends ViewableData { $this->titleField = $titleField; $this->descriptionField = $descriptionField; $this->authorField = $authorField; + + parent::__construct(); } /** diff --git a/api/RestfulService.php b/api/RestfulService.php index 14e31addf..58df03c79 100644 --- a/api/RestfulService.php +++ b/api/RestfulService.php @@ -23,6 +23,7 @@ class RestfulService extends ViewableData { function __construct($base, $expiry=3600){ $this->baseURL = $base; $this->cache_expire = $expiry; + parent::__construct(); } /** diff --git a/core/TokenisedRegularExpression.php b/core/TokenisedRegularExpression.php index 87ebe6147..0fc65bcc0 100644 --- a/core/TokenisedRegularExpression.php +++ b/core/TokenisedRegularExpression.php @@ -14,6 +14,7 @@ class TokenisedRegularExpression extends Object { function __construct($expression) { $this->expression = $expression; + parent::__construct(); } function findAll($tokens) { diff --git a/core/ValidationResult.php b/core/ValidationResult.php index 65e5082a8..9c4ed3f0b 100644 --- a/core/ValidationResult.php +++ b/core/ValidationResult.php @@ -25,6 +25,7 @@ class ValidationResult extends Object { function __construct($valid = true, $message = null) { $this->isValid = $valid; if($message) $this->errorList[] = $message; + parent::__construct(); } /** diff --git a/core/model/DataDifferencer.php b/core/model/DataDifferencer.php index 2d87670e9..4846ff03e 100644 --- a/core/model/DataDifferencer.php +++ b/core/model/DataDifferencer.php @@ -45,6 +45,7 @@ class DataDifferencer extends ViewableData { if(!$toRecord) user_error("DataDifferencer constructed without a toRecord", E_USER_WARNING); $this->fromRecord = $fromRecord; $this->toRecord = $toRecord; + parent::__construct(); } /** diff --git a/core/model/YamlFixture.php b/core/model/YamlFixture.php index 031aed09e..b2b3aa713 100644 --- a/core/model/YamlFixture.php +++ b/core/model/YamlFixture.php @@ -88,6 +88,7 @@ class YamlFixture extends Object { } $this->fixtureFile = $fixtureFile; + parent::__construct(); } /** diff --git a/dev/CSSContentParser.php b/dev/CSSContentParser.php index 274dda197..843533dd1 100644 --- a/dev/CSSContentParser.php +++ b/dev/CSSContentParser.php @@ -45,9 +45,9 @@ class CSSContentParser extends Object { $tidy = $content; } - - $this->simpleXML = new SimpleXMLElement($tidy); + + parent::__construct(); } /** diff --git a/dev/CSVParser.php b/dev/CSVParser.php index 57b5822c2..4a8c387d2 100644 --- a/dev/CSVParser.php +++ b/dev/CSVParser.php @@ -76,6 +76,7 @@ class CSVParser extends Object implements Iterator { $this->filename = $filename; $this->delimiter = $delimiter; $this->enclosure = $enclosure; + parent::__construct(); } /** diff --git a/dev/ModelViewer.php b/dev/ModelViewer.php index 8159bb9f2..0b9fb5adb 100644 --- a/dev/ModelViewer.php +++ b/dev/ModelViewer.php @@ -115,6 +115,7 @@ class ModelViewer_Model extends ViewableData { function __construct($className) { $this->className = $className; + parent::__construct(); } function getModule() { diff --git a/email/Email.php b/email/Email.php index a3a137553..41502b73e 100755 --- a/email/Email.php +++ b/email/Email.php @@ -149,6 +149,7 @@ class Email extends ViewableData { $this->cc = $cc; $this->bcc = $bcc; $this->setBounceHandlerURL($bounceHandlerURL); + parent::__construct(); } public function attachFileFromString($data, $filename, $mimetype = null) { diff --git a/forms/FormScaffolder.php b/forms/FormScaffolder.php index aa5ddd08b..38708ba2d 100644 --- a/forms/FormScaffolder.php +++ b/forms/FormScaffolder.php @@ -53,6 +53,7 @@ class FormScaffolder extends Object { */ function __construct($obj) { $this->obj = $obj; + parent::__construct(); } /** diff --git a/forms/ReportField.php b/forms/ReportField.php index afd4da511..4e191fb8e 100755 --- a/forms/ReportField.php +++ b/forms/ReportField.php @@ -332,6 +332,7 @@ class ReportField_SimpleFilter extends Object { function __construct( $hiddenColumns ) { $this->hiddenFields = $hiddenColumns; + parent::__construct(); } function columnIsVisible( $table, $column ) {