]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Fixes #4068 not forcing update on adds when the subtype exists Refs #4058
authorCash Costello <cash.costello@gmail.com>
Sun, 6 Nov 2011 21:44:05 +0000 (16:44 -0500)
committerCash Costello <cash.costello@gmail.com>
Sun, 6 Nov 2011 21:44:05 +0000 (16:44 -0500)
engine/lib/entities.php
mod/blog/activate.php
mod/thewire/activate.php

index 711fcbbd7fa0fc91dce59e90151a77823d65e426..fd2b0e9f935b39b5c40acdf5f5405414014c6887 100644 (file)
@@ -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;
index 5f67ffbed0266b9db340d9bd3fd299fd2d224584..a90525291f9a6edd20883f8ddca5375d4b5577cd 100644 (file)
@@ -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');
+}
index 1db83f7be903bda82e3b18b43eaab7d8e1116980..1cc64ceb1d08c6776ffc9a24a79faad8faf7fd1d 100644 (file)
@@ -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');
+}