Or creating a user just for the purpose of transferring all content formerly owned by accounts to be deleted to. Maybe easier to handle it this way if the content is supposed to be accessible on site as some plugins might rather expect the owner being of type user and not site.
As for the garbage collection: the plugin searches the database for orphaned data (I think maybe mostly metadata/metastrings). If these database entries have an owner_id pointing to an entity no longer existing it gets removed. That's a rather short explanation (that might even in parts be wrong as I've not looked into the code to see what exactly is done). Anyway, the hook might not help to prevent deletion because the garbage collection would rather use raw MySQL code instead of making use of Elgg API functions (that would call the hooks).
Thank you iionly.
From your answer I understand Jerome's comment about the Garbage collection plugin. The prevent deletion hook can create orphans which may be deleted by the garbage collection. So, this approach is not recommended.
Or creating a user just for the purpose of transferring all content formerly owned by accounts to be deleted to. Maybe easier to handle it this way if the content is supposed to be accessible on site as some plugins might rather expect the owner being of type user and not site.
I do not understand this comment. Could you please explain it?
Do you think that making the objects owned/contained by the Site is not advisable?
Thank you very much.
We can put the owner and container in in metadata
Thank you Jerome.
PS: please try updating to Elgg 3.3 then you don't have to worry about subtype id's and metastring id's
As one member responded lately to your suggestion "I'm afraid". I have many plugins and many features. It will take me long time to update. I cannot do it right now, but I heard from you that Elgg 4 is coming soon. So, hopefully I'll go directly to Egg 4.
Is it possible to go from 2.3 to 4 ?
@reuven you will need to upgrade to 3.3 first (at least for Elgg) and then go to 4.x. This can be done on the same day, but you need to do both steps.
Thank you Jeroen
Have a look at the documentation here: http://learn.elgg.org/en/stable/guides/database.html?highlight=sizes#entity-icons
Be aware that this information is for Elgg 3. The icon sizes hook also exists in Elgg 2.x, but the thumbnails are only generated when uploading a new icon. In Elgg 3 they are generated on demand.
Thank you Jeroen
This mischievous hook on Elgg 2.3 works well --> elgg_register_plugin_hook_handler('entity:icon:sizes', 'object', 'set_custom_icon_sizes') :)
Change on:
public function save($update_last_action = null) {
$result = false;
$update_last_action = true;
if (elgg_trigger_before_event('create', 'object', $this)) {
$result = parent::save();
if ($result && $update_last_action) {
elgg_trigger_after_event('create', 'object', $this);
}
}
return $result;
}
Works great.
Thank you very much RvR.
I wish I can do it myself some day... maybe next incarnation .... :)
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by Raül Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.