aboutsummaryrefslogtreecommitdiff
path: root/engine/classes/ElggPlugin.php
diff options
context:
space:
mode:
Diffstat (limited to 'engine/classes/ElggPlugin.php')
-rw-r--r--engine/classes/ElggPlugin.php13
1 files changed, 6 insertions, 7 deletions
diff --git a/engine/classes/ElggPlugin.php b/engine/classes/ElggPlugin.php
index 8c9093834..c6ce2905f 100644
--- a/engine/classes/ElggPlugin.php
+++ b/engine/classes/ElggPlugin.php
@@ -36,8 +36,9 @@ class ElggPlugin extends ElggObject {
* @warning Unlike other ElggEntity objects, you cannot null instantiate
* ElggPlugin. You must point it to an actual plugin GUID or location.
*
- * @param mixed $plugin The GUID of the ElggPlugin object or the path of
- * the plugin to load.
+ * @param mixed $plugin The GUID of the ElggPlugin object or the path of the plugin to load.
+ *
+ * @throws PluginException
*/
public function __construct($plugin) {
if (!$plugin) {
@@ -76,6 +77,8 @@ class ElggPlugin extends ElggObject {
// load the rest of the plugin
parent::__construct($existing_guid);
}
+
+ _elgg_cache_plugin_by_id($this);
}
/**
@@ -101,7 +104,6 @@ class ElggPlugin extends ElggObject {
$missing_attributes = array_diff_key($expected_attributes, $row);
if ($missing_attributes) {
$needs_loaded = true;
- $old_guid = $guid;
$guid = $row['guid'];
} else {
$this->attributes = $row;
@@ -132,10 +134,7 @@ class ElggPlugin extends ElggObject {
// guid needs to be an int http://trac.elgg.org/ticket/4111
$this->attributes['guid'] = (int)$this->attributes['guid'];
- // cache the entity
- if ($this->attributes['guid']) {
- cache_entity($this);
- }
+ cache_entity($this);
return true;
}