aboutsummaryrefslogtreecommitdiff
path: root/mod/subgroups/activate.php
diff options
context:
space:
mode:
Diffstat (limited to 'mod/subgroups/activate.php')
-rw-r--r--mod/subgroups/activate.php16
1 files changed, 16 insertions, 0 deletions
diff --git a/mod/subgroups/activate.php b/mod/subgroups/activate.php
new file mode 100644
index 000000000..1e173fdd5
--- /dev/null
+++ b/mod/subgroups/activate.php
@@ -0,0 +1,16 @@
+<?php
+/**
+ * Unsets container guids from all groups that aren't subgroups
+ */
+
+$groups = elgg_get_entities(array(
+ 'type' => 'group',
+ 'limit' => 0,
+));
+
+foreach($groups as $group) {
+ if (!elgg_instanceof($group->getContainerEntity(), 'group')) {
+ $group->container_guid = 0;
+ $group->save();
+ }
+}