]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Fixes #4882. Added upgrade for The Wire to register thewire objects as ElggWire class.
authorBrett Profitt <brett.profitt@gmail.com>
Thu, 27 Dec 2012 21:59:49 +0000 (16:59 -0500)
committerBrett Profitt <brett.profitt@gmail.com>
Thu, 27 Dec 2012 21:59:49 +0000 (16:59 -0500)
mod/thewire/start.php
mod/thewire/upgrades/2012122701-fix_entity_class.php [new file with mode: 0644]

index 1ba48263a3094dac1c567f4b3a192057b049b6a7..8b01cc57a3f821717324c3474f6a152e92b8cb8e 100644 (file)
@@ -67,6 +67,8 @@ function thewire_init() {
        elgg_register_action("thewire/delete", "$action_base/delete.php");
 
        elgg_register_plugin_hook_handler('unit_test', 'system', 'thewire_test');
+
+       elgg_register_event_handler('upgrade', 'system', 'thewire_run_upgrades');
 }
 
 /**
@@ -462,3 +464,12 @@ function thewire_test($hook, $type, $value, $params) {
        $value[] = $CONFIG->pluginspath . 'thewire/tests/regex.php';
        return $value;
 }
+
+function thewire_run_upgrades() {
+       $path = dirname(__FILE__) . '/upgrades/';
+       $files = elgg_get_upgrade_files($path);
+       
+       foreach ($files as $file) {
+               include $path . $file;
+       }
+}
\ No newline at end of file
diff --git a/mod/thewire/upgrades/2012122701-fix_entity_class.php b/mod/thewire/upgrades/2012122701-fix_entity_class.php
new file mode 100644 (file)
index 0000000..a1f3827
--- /dev/null
@@ -0,0 +1,8 @@
+<?php
+/**
+ * Register thewire objects with the ElggWire class.
+ */
+
+if (get_subtype_id('object', 'thewire')) {
+       update_subtype('object', 'thewire', 'ElggWire');
+}
\ No newline at end of file