From a200c487f2cfd47d70f14004915a3fc35af99261 Mon Sep 17 00:00:00 2001 From: mjollnir_ Date: Tue, 9 Sep 2008 13:44:16 +0000 Subject: [PATCH] MDL-16405 - throw the right exception during admin operations to avoid unnecessary debugging notice. --- lib/portfolio/plugin.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/portfolio/plugin.php b/lib/portfolio/plugin.php index 297d7bc7a1..154eaf7588 100644 --- a/lib/portfolio/plugin.php +++ b/lib/portfolio/plugin.php @@ -644,7 +644,10 @@ abstract class portfolio_plugin_base { return true; } $a = (object)array('property' => $field, 'class' => get_class($this)); - throw new portfolio_export_exception($this->get('exporter'), 'invalidproperty', 'portfolio', null, $a); + if ($this->get('exporter')) { + throw new portfolio_export_exception($this->get('exporter'), 'invalidproperty', 'portfolio', null, $a); + } + throw new portfolio_exception('invalidproperty', 'portfolio', null, $a); // this happens outside export (eg admin settings) } -- 2.39.5