Will updating the access of an object/entity automatically update the access of relevant river items?

Hi all,

just a quick question that I couldn't find any info on. If I update the access value of an object (say a file) will any river items from that object (creation, update, annotate) also receive the new access value?

For example... Uploaded a file, saved with access Logged in. Any member can see that river item. Now change that access to Friends. Will any member still be able to see the river item or now only friends?



  • Elgg River has it's own access_id --
    River Core code has Update River API..
    Entity Update calls update_river_access_by_object() and
    so I'd expect that River Item's access_id to be also updated..
    but not sure whether by subject or object on River ;(

  • Ok, I'm doing my check via river items so if the user decides to update the access of the object itself (from river) then to run a following call to update_river_access_by_object().

    Thanks D. I'll send you a copy of code when finished. Improving my old river_controls plugin. Uses full Ajax now and these new options allow for much more power from the dashboard.

  • Just be certain of whose guid is being sent over =>
    -- river item's subject or object ?
    Entity :=

    function save() {
        $guid = (int) $this->guid;
        if ($guid > 0) {
            return update_entity($this->get('guid') .. $access_id ...

    function update_entity($guid, $owner_guid, $access_id, $container_guid = null, $time_created = null) {
    update_river_access_by_object($guid, $access_id);

    River :=

    function update_river_access_by_object($object_guid, $access_id) {


  • Thanks D.

    Out of interest, is a river item an entity? I'm looking for a function to get the item from its id, but haven't been able to find it yet.

    I could do it from object_guid, but at the moment my river is setup to look at river items individually, not based on the object_guid. As it is possible that when viewing the river, two items can have the same object guid based on how much interaction there is with that entity.

  • river not = entity ;) independent table by itself.
    Elgg1801\engine\lib\river.php for core code
    the river item row references 2 guids :-
    . subject_guid (entity who did it)
    . object_guid  (entity who was done to)
    + read over up river structure for more stuff.



  • so is there currently no way to get a river item from it's id?

  • if you know the river item's id#
    function elgg_get_river(array $options = array())
    will take array of id#(s)
    tho still returns array of items

  • I'm on 1.7 and can't seem to find elgg_get_river() in the reference.elgg.org. Is that a 1.8 function or just not in the reference?

  • ;-) 1.7 ?

    function get_river_items($subject_guid = 0, $object_guid = 0, $subject_relationship = '', $type = '',

  • lol I know. stablish 1.8 came out the day after we "opened". Not much that could be done about that really, also kinda prefer the 1.7 appearance to the 1.8.

    I'll send you the plugin to have a look at sometime today. You'll get where I'm coming from. I might have to write a custom function for get_river_item_by_id().