I'm currently switching from elgg 1.5 to current 1.8 version. As I noticed, the joined groups of a user are not displayed, as I expected.
I dived into the groups/lib/groups.php and had a look at groups_handle_mine_page(). I don't understand the separation for page_owner and not page_owner. The name of the function implicates, this function lists all of MY (the users) joined groups (not for something else).
In my case, the page_owner is the admin. The user, who is calling this function, is someone diffent.
I tryed to change the code from
$content = elgg_list_entities_from_relationship(array(
'type' => 'group',
'relationship' => 'member',
'relationship_guid' => elgg_get_page_owner_guid(),
'inverse_relationship' => false,
'full_view' => false,
));
to
$content = elgg_list_entities_from_relationship(array(
'type' => 'group',
'relationship' => 'member',
'relationship_guid' => elgg_get_logged_in_user_guid(),
'inverse_relationship' => false,
'full_view' => false,
));
and that is working for me.
If I'm right, then some of the lines above may be obsolete, and it my be senseful to check the function groups_handle_owned_page() for the same reason.
BTW: I think, it would be much more consistent to have "memberships" and "ownerships" in the tabbed menue instead of having them in the sidebar. (I already changed this for my needs.)
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.
- Juho Jaakkola@juho.jaakkola
Juho Jaakkola - 0 likes
- westor@westor
westor - 0 likes
- Juho Jaakkola@juho.jaakkola
Juho Jaakkola - 0 likes
- westor@westor
westor - 0 likes
You must log in to post replies.You don't have to change anything (and you shouldn't). The page_owner is there to support browsing both user's own groups and the groups of anyone else whose username you add to the url.
Example 1 - You are logged in:
www.site.com/groups/owner/westor
Displays the groups that you own. The heading is "Groups I own".
www.site.com/groups/owner/john
Displays the groups that the user John owns. The heading is "Groups John owns". The heading changes because page_owner != logged_in_user (John != Westor).
Example 2 - User John is logged in:
www.site.com/groups/owner/john
Title: "Groups I own"
www.site.com/groups/onwer/westor
Title: "Groups Westor owns"
Yes, that's what I would expect. But why this is not working - at least not for me? May be a datastructure change (elgg 1.5.x upgraded)?
What is the page_owner in this case?
So what exactly do you see on that page (without your modifications)? How does it change when you change someone else's username to the URL? Did I understand correctly that it thinks page owner is always admin no matter whose username you use?
Oh, thank you for answering here, I found my mystake - I have an url issue with the name. OK, if you use a not exiting username, you will get all groups back: .../community/groups/member/xxxx