We have moved to Github. Please open tickets there.

Opened 17 months ago

Closed 17 months ago

Last modified 16 months ago

#4204 closed Defect (fixed)

Make ElggSite class consistent with user membership

Reported by: fabcol Owned by:
Priority: normal Milestone: Elgg 1.8.3
Component: Core Version: 1.8.1
Severity: minor Keywords: multisite, users, site
Cc: brett@… Difficulty:

Description

As users membership is based on a "member_of_site" relationship, some function in ElggSite class should be adapted to be consistent with this behaviour. a 'site_guids' => ELGG_ENTITIES_ANY_VALUE, should be added :

public function getMembers($options = array(), $offset = 0) {

if (!is_array($options)) {

elgg_deprecated_notice("ElggSite::getMembers uses different arguments!", 1.8);
$options = array(

'limit' => $options,
'offset' => $offset,

);

}

$defaults = array(

'site_guids' => ELGG_ENTITIES_ANY_VALUE,

'relationship' => 'member_of_site',
'relationship_guid' => $this->getGUID(),
'inverse_relationship' => TRUE,
'type' => 'user',

);

$options = array_merge($defaults, $options);

return elgg_get_entities_from_relationship($options);

}

public function listMembers($options = array()) {

$defaults = array(

'site_guids' => ELGG_ENTITIES_ANY_VALUE,

'relationship' => 'member_of_site',
'relationship_guid' => $this->getGUID(),
'inverse_relationship' => TRUE,
'type' => 'user',

);

$options = array_merge($defaults, $options);

return elgg_list_entities_from_relationship($options);

}

Change History (5)

comment:1 Changed 17 months ago by fabcol

  • Version changed from 1.8.1b1 to 1.8.1

comment:2 Changed 17 months ago by cash

I do not understand this. When you call ElggSite::getmembers() you should get those who are members of that particular site, not from a list of site guids. What are you trying to accomplish here?

comment:3 Changed 17 months ago by cash

  • Milestone changed from Needs Review to Elgg 1.8.3
  • Severity changed from major to minor

Never mind. I understand now. elgg_get_entities() by default only uses the current site.

comment:4 Changed 17 months ago by cash

  • Resolution set to fixed
  • Status changed from new to closed

Fixes #4204 using only the relationship for getting members of a site

Changeset: 7916edda4afa2c75654a120a40f2e04c46079b57

comment:5 Changed 16 months ago by cash

Fixes #4204 using only the relationship for getting members of a site

Changeset: 7916edda4afa2c75654a120a40f2e04c46079b57

Note: See TracTickets for help on using tickets.