Just curious, why doesn't this function delete each entity's associated subtypes and metadata?
http://reference.elgg.org/entities_8php.html#b1cec89ed4e555dfe915eb45cb450c08
I see all the orphoned records in my DB after deleting entities.
Specifically, I see data in this table that was related to the entities which were deleted. It's as if a foreign key relationship was broken.
elggmetastrings
I do find it odd though that this page says the opposite should be true,
http://docs.elgg.org/wiki/Engine/DataModel/Entities
If you delete an ElggEntity, whether it be a site, user, object or group all its metadata and annotations will be automatically deleted.
Does anyone know what I may be doing wrong? I'm on v.1.5.
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.
- DhrupDeScoop@Dhrup2000
DhrupDeScoop - 0 likes
- Kane@kane
Kane - 0 likes
- DhrupDeScoop@Dhrup2000
DhrupDeScoop - 0 likes
- Kevin Jardine@kevin
Kevin Jardine - 0 likes
- ChungNg@ChungNg
ChungNg - 0 likes
- DhrupDeScoop@Dhrup2000
DhrupDeScoop - 0 likes
You must log in to post replies.not to worry..;-)
known bug
much has been discussed on other topics re: this phenomenon ;-(
believe Elgg team are working on this.. ;-)
Phew..thought I was going crazy for a sec ;)
Do you know of a workaround until they fix it or should we just leave those records in the DB?
Does the "garbagecollector" plugin take care of them by any chance?
http://community.elgg.org/mod/groups/topicposts.php?topic=134228&group_guid=52477
Actually, Dhrup, I don't think that this is a known bug. Is it in Trac?
I'm pretty sure that the code in SVN deletes all related records in the database. I don't remember whether it did this for Elgg 1.5 or not.
I believe all metadata and annotation records are deleted. What is not deleted are the metastrings.
The metastrings can be used by more than one metadata/annotation record. So, deleting the metadata record or the annotation record does not in itself guarantee that the metastring is no longer used. The checking of who is using a particular metastring is somewhat time consuming if done for each delete of metadata or annotation, partly because you need to clear the cache.
I have a use case where I create annotation records with unique metastrings (in my particular case they are pointers to a file) which I know its not used by any other annotation of metastring. So, I have been thinking about asking for a modified delete of metadata or annotation that would delete also the metastring associated with the value-id. Note, the metastring associated with the name-id is almost always reused.
http://community.elgg.org/mod/groups/topicposts.php?topic=180489&group_guid=52477