I believe there is an error in the procedure [template::list::page_get_rowcount]
The pagination somehow alters the total number of members every time a new pagination is selected.
I debugged the API and i ended up with the following queries:
#1. Using paginaton with 50 records per page:
select r.rel_id,
u.first_names || ' ' || u.last_name as name
from acs_rels r,
membership_rels mr,
cc_users u
where r.object_id_one = :group_id
and r.rel_type = 'membership_rel'
and mr.rel_id = r.rel_id
and u.user_id = r.object_id_two
and
mr.member_state = :member_state
order by lower(u.first_names || ' ' || u.last_name) asc
offset 0
limit 550
#2.Using paginaton with 100 records per page:
select r.rel_id,
u.first_names || ' ' || u.last_name as name
from acs_rels r,
membership_rels mr,
cc_users u
where r.object_id_one = :group_id
and r.rel_type = 'membership_rel'
and mr.rel_id = r.rel_id
and u.user_id = r.object_id_two
and
mr.member_state = :member_state
order by lower(u.first_names || ' ' || u.last_name) asc
offset 0
limit 1100
#3. select r.rel_id,
u.first_names || ' ' || u.last_name as name
from acs_rels r,
membership_rels mr,
cc_users u
where r.object_id_one = :group_id
and r.rel_type = 'membership_rel'
and mr.rel_id = r.rel_id
and u.user_id = r.object_id_two
and
mr.member_state = :member_state
order by lower(u.first_names || ' ' || u.last_name) asc
offset 0
limit 5500
Paying attetion to the "limit" values: 550, 1100, and 5500 they are exactly the amount of members that show up unproperly. Although the subiste has around of 87 thousand members.
Is it possible the error be in the "limit" of the query?
What is the relation between "limit" and the counter of members (total of members)?
I couldn't easily track dqon the query because it is built dinamically depending the arguments passed.
https://openacs.org/api-doc/proc-view?proc=template::list::page_get_rowcount&source_p=1&version_id=
Furthemore, how users and subsites are related (what tables are used)? acs_rels and user?
cheers,