From 36e5d2b45f9ec240c0cecbb78afcce92e2962a49 Mon Sep 17 00:00:00 2001 From: Eric Helgeson Date: Tue, 4 Aug 2009 22:11:20 -0500 Subject: Added correct null check. Created noisey errors on fresh install. $id is not defined, should be $this->id --- classes/Design.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'classes/Design.php') diff --git a/classes/Design.php b/classes/Design.php index 43544f1c9..b53096aa2 100644 --- a/classes/Design.php +++ b/classes/Design.php @@ -107,7 +107,7 @@ class Design extends Memcached_DataObject static function toWebColor($color) { - if (is_null($color)) { + if ($color == null) { return null; } @@ -115,7 +115,7 @@ class Design extends Memcached_DataObject return new WebColor($color); } catch (WebColorException $e) { // This shouldn't happen - common_log(LOG_ERR, "Unable to create color for design $id.", + common_log(LOG_ERR, "Unable to create color for design $this->id.", __FILE__); return null; } -- cgit v1.2.3-54-g00ecf From 44b2b6424714f82dc199fbe9780843638122e3ad Mon Sep 17 00:00:00 2001 From: Adrian Lang Date: Wed, 5 Aug 2009 16:05:29 +0200 Subject: Argh, first commit for ages and such a stupid error. Sorry. --- classes/Design.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'classes/Design.php') diff --git a/classes/Design.php b/classes/Design.php index b53096aa2..9354bfcda 100644 --- a/classes/Design.php +++ b/classes/Design.php @@ -115,7 +115,7 @@ class Design extends Memcached_DataObject return new WebColor($color); } catch (WebColorException $e) { // This shouldn't happen - common_log(LOG_ERR, "Unable to create color for design $this->id.", + common_log(LOG_ERR, "Unable to create web color for $color", __FILE__); return null; } -- cgit v1.2.3-54-g00ecf From bbf10e5bdf3ee0dfa372b170da6e25bee859b3c5 Mon Sep 17 00:00:00 2001 From: Adrian Lang Date: Mon, 10 Aug 2009 15:01:00 +0200 Subject: common_config returns false if the config value is not set. Design::toWebColor checks with is_null. Hence the common_config value should be adjusted. --- classes/Design.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'classes/Design.php') diff --git a/classes/Design.php b/classes/Design.php index 9354bfcda..19c9e0292 100644 --- a/classes/Design.php +++ b/classes/Design.php @@ -204,7 +204,10 @@ class Design extends Memcached_DataObject 'disposition'); foreach ($attrs as $attr) { - $siteDesign->$attr = common_config('design', $attr); + $val = common_config('design', $attr); + if ($val !== false) { + $siteDesign->$attr = $val; + } } } -- cgit v1.2.3-54-g00ecf