i am looking at adding filters to the river here and would like to be able to choose to filter the river based on the container guid of the river items.
i should be able to just add the container guid to the query that retrieves the river data by way of using 'target_guids' according to the source for elgg_get_river(), but every river item i have looked at so far has a target_guid of zero... so this approach does not work.
am i missing something here? is the only way to do this to use custom joins / wheres etc. ?
thanks
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.
oh, so 'object_guid' appears to be usable in the case of groups... so far!
The target_guid is relatively new column in the table, so most plugins don't use it for anything (yet?). Therefore it is empty in most cases.
In case you want to filter specifically with container_guid of the river object, you can use oe.container_guid in where clauses.
i see, ok. i am looking at the objects_entity table and it has the structure: guid, title, description. there is no container_guid available in that table.
the query i am using presently, which i partially borrowed from another recent thread in the community which was aiming to do something similar to my objective is:
this appears to be working, but i haven't looked closely enough at the database yet to know if it is getting every river entry or not.
No, the join is not made to the objects_entity table but entities table, which does have the container_guid column.
https://github.com/Elgg/Elgg/blob/2.0/engine/lib/river.php#L352
oh i see - ok - so 'oe' was just a table alias in that query that points to the entities table. so is there any way to use or purpose in using the target_guid in this context?
Yes, there is a way:
But purpose? No, probably not.
since it's not clear from that file what the te alias points to (and no table name begins with t) i imagine that the alias points to the entities table too. i have no idea what the value of the target_guid is useful for... so i'll leave it alone!
Target GUID was added for one reason only: comments were migrated from annotation to entities, so we needed a new river column to make the river items meaningful:
ah, i see ok. it would be helpful to others if that information was added to the river page in the elgg guide as i haven't seen that written anywhere: http://learn.elgg.org/en/2.0/guides/river.html
- Previous
- 1
- 2
- Next
You must log in to post replies.