From 2615252b460c01dd54170fed510516a1c50e3a42 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sun, 6 Nov 2011 07:55:11 -0500 Subject: Fixes #4067 adds activate/deactivate scripts --- mod/thewire/activate.php | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 mod/thewire/activate.php (limited to 'mod/thewire/activate.php') diff --git a/mod/thewire/activate.php b/mod/thewire/activate.php new file mode 100644 index 000000000..1db83f7be --- /dev/null +++ b/mod/thewire/activate.php @@ -0,0 +1,6 @@ + Date: Sun, 6 Nov 2011 16:44:05 -0500 Subject: Fixes #4068 not forcing update on adds when the subtype exists Refs #4058 --- engine/lib/entities.php | 2 -- mod/blog/activate.php | 6 +++++- mod/thewire/activate.php | 6 +++++- 3 files changed, 10 insertions(+), 4 deletions(-) (limited to 'mod/thewire/activate.php') diff --git a/engine/lib/entities.php b/engine/lib/entities.php index 711fcbbd7..fd2b0e9f9 100644 --- a/engine/lib/entities.php +++ b/engine/lib/entities.php @@ -306,8 +306,6 @@ function add_subtype($type, $subtype, $class = "") { if ($id == 0) { return insert_data("insert into {$CONFIG->dbprefix}entity_subtypes" . " (type, subtype, class) values ('$type','$subtype','$class')"); - } else { - update_subtype($type, $subtype, $class); } return $id; diff --git a/mod/blog/activate.php b/mod/blog/activate.php index 5f67ffbed..a90525291 100644 --- a/mod/blog/activate.php +++ b/mod/blog/activate.php @@ -3,4 +3,8 @@ * Register the ElggBlog class for the object/blog subtype */ -add_subtype('object', 'blog', 'ElggBlog'); +if (get_subtype_id('object', 'blog')) { + update_subtype('object', 'blog', 'ElggBlog'); +} else { + add_subtype('object', 'blog', 'ElggBlog'); +} diff --git a/mod/thewire/activate.php b/mod/thewire/activate.php index 1db83f7be..1cc64ceb1 100644 --- a/mod/thewire/activate.php +++ b/mod/thewire/activate.php @@ -3,4 +3,8 @@ * Register the ElggWire class for the object/thewire subtype */ -add_subtype('object', 'thewire', 'ElggWire'); +if (get_subtype_id('object', 'thewire')) { + update_subtype('object', 'thewire', 'ElggWire'); +} else { + add_subtype('object', 'thewire', 'ElggWire'); +} -- cgit v1.2.3