1234567891011121314151617181920212223242526272829303132 |
- <?php
- global $CONFIG;
- $ia = elgg_set_ignore_access(true);
- $access_status = access_get_show_hidden_status();
- access_show_hidden_entities(true);
- $options = array(
- 'type' => 'site',
- 'site_guid' => 0,
- 'limit' => 0,
- );
- $batch = new \ElggBatch('elgg_get_entities', $options);
- foreach ($batch as $entity) {
- if (!$entity->site_guid) {
- update_data("UPDATE {$CONFIG->dbprefix}entities SET site_guid=$entity->guid
- WHERE guid=$entity->guid");
- }
- }
- access_show_hidden_entities($access_status);
- elgg_set_ignore_access($ia);
|