Thanks,
Ok, I will try to explain me better...
First,
Records (in entities table) site type without his sites_entity table record.
It means that when I try to call elgg_get_entities(array('type'=>'site')); an error occurs. It because Elgg get the record from entities table, but when try to get the record from sites_entity table, it has been deleted, or has not created... then can't do an array_merge($entities_record, null).... To fix it, I must delete the entities table record, or set to enabled=no, or manually create sites_entity record... (invent..!)
In some records, his guid field value corresponds to an users_entity table record.
In this case, I get using SQL sites broken, like as previous explanation... But, the guid entity I can found in users_entity table!!!.. Then I think: "something has changed type value in entities table"... but... how? I dont understand it.. Bad manipulation? Manteinance operations? I dont know. I am in investigation, each time, some entities appears broken....
In this case, we are working in reordering of the engine leaving only data access functions.
Really, I doubt that an error can be originated by reordering. When I say "reordering", it means that I leave only data access functions.. For example: elgg_get_entityes(), get_entity(), crate_entity(), update_entity(), delete_entity(),.... for entities, objects, users, sites, groups, metadata, private settings, and annotations....
If Dbvalidator plugin exists, it means that elgg have some problems with the database.
A imporant point is that the database havent how ensure referential integrity, like foreign keys, indexes, transactions, etc... Try to ensure referential integrity by php code, is not a good idea... O.O ---
Regards...
I just tested both cases on my installation and there's no break.
In fact the plugin I'm working on right now uses elgg_get_entities('types' => array('user')) with perfect results.
All I can suggest is making a clean install and testing on that, then looking for the differences. Not much else I can tell you, good luck!
ok... no problem.. thanks for your time...
I will go on investigation...
If I found any bug, I will want to report to community!!
Regards!
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.