diff --git a/application/models/Plugin.php b/application/models/Plugin.php index a9212dd3dab..7f76299af8a 100644 --- a/application/models/Plugin.php +++ b/application/models/Plugin.php @@ -47,9 +47,14 @@ public function tableName() */ public function setLoadError(array $error) { - $this->load_error = 1; - $this->load_error_message = $error['message'] . ' ' . $error['file']; - return $this->update(); + // NB: Don't use ActiveRecord here, since it will trigger events and + // load the plugin system all over again. + // TODO: Works on all SQL systems? + $sql = sprintf( + "UPDATE {{plugins}} SET load_error = 1, load_error_message = '%s' WHERE id = " . $this->id, + addslashes($error['message'] . ' ' . $error['file']) + ); + return \Yii::app()->db->createCommand($sql)->execute(); } /**