OJS 3.5 — "Send Email" (Users & Roles) shows "0 users" in the confirmation, but emails are actually sent

Description

In Users & Roles → Send Email (the bulk email tool that targets users by role), the confirmation dialog reports the wrong recipient count. After selecting one or more roles, the confirmation reads:

“You are about to send an email to 0 users. Are you sure you want to send this email?”

However, the email is actually delivered to the users in the selected role(s). So the count shown is wrong — it displays 0 regardless of how many users the role contains.

(see screenshot below)

Steps to reproduce

  1. Make sure bulk emails are enabled for the journal (Admin → Site Settings → the journal is in the allowed list).
  2. Go to Users & Roles → Send Email.
  3. Select a role that clearly has several users.
  4. Fill subject/body and submit.
  5. Observe the confirmation dialog: it says “0 users”.
  6. Confirm — the recipients do receive the email.

Expected behavior

The confirmation should display the actual number of users in the selected role(s).

Actual behavior

The confirmation always shows 0, while delivery works correctly. The counter and the actual send appear to be independent code paths.

Notes from a quick look at the code

The confirmation total ({$total} in manager.setup.notifyUsers.confirm) is built from userGroupCounts in PKPNotifyUsersForm, populated via:

php

UserGroup::withContextIds($context->getId())
    ->withCount(['userUserGroups as userCount'])
    ->get();

The per-role userCount is passed to the form config and summed on the frontend for the selected roles. Since delivery works but the displayed total is 0, the problem looks isolated to this counter (either userCount not being populated server-side, or the client-side sum not matching the selected role IDs).

Can someone confirm whether this is a known issue? Happy to file it on GitHub if useful.

What application are you using?
For example, OJS 3.5.0-5