Permalink
Browse files

fix(boot): make sure boot cache updated when subtype data changes

  • Loading branch information...
mrclay committed Aug 10, 2016
1 parent 7af921f commit c80f6e64701320fdc83904719ca4bb2305079a5c
Showing with 5 additions and 2 deletions.
  1. +5 −2 engine/classes/Elgg/Database/SubtypeTable.php
@@ -15,7 +15,7 @@
class SubtypeTable {
/**
- * @var array|null
+ * @var \stdClass[]|null
*/
private $cache = null;
@@ -245,7 +245,8 @@ function add($type, $subtype, $class = "") {
':class' => $class,
];
$id = $this->db->insertData($sql, $params);
-
+ _elgg_services()->boot->invalidateCache();
+
// add entry to cache
$cache_obj->id = $id;
$this->cache[$id] = $cache_obj;
@@ -278,6 +279,7 @@ function remove($type, $subtype) {
':subtype' => $subtype,
];
$success = $this->db->deleteData($sql, $params);
+ _elgg_services()->boot->invalidateCache();
if ($success) {
// invalidate the cache
@@ -318,6 +320,7 @@ function update($type, $subtype, $class = '') {
':id' => $id,
];
$success = $this->db->updateData($sql, false, $params);
+ _elgg_services()->boot->invalidateCache();
if ($success && isset($this->cache[$id])) {
$this->cache[$id]->class = $class;

0 comments on commit c80f6e6

Please sign in to comment.