drachels / moodle-mod_diary

A daily diary activity for Moodle.
4 stars 6 forks source link

View Entries shows all users in the system #28

Closed patriclougheed closed 10 months ago

patriclougheed commented 1 year ago

In Moodle 4.0.5 when I go to view the entries, in this case it says 21 entries, the view shows every single person in the system and not just the ones enrolled. Every other person is empty and it does take a while to load the page as it is calling records for all.

I tested this in my test environment running with 4.1.3 and has the same issue.

drachels commented 1 year ago

I am unable to duplicate your problem. When I go to view the entries, I only see students who are enrolled in the course. I can further shorten the list length by using groups.

Also, it would help to know some more details:

As I said, I am unable to duplicate this problem on Moodle 4.0.8+, using Diary v3.7.4, MariaDB 10.6.12, and PHP 7.4.33 on Ubuntu 22.04.02 LTS.

patriclougheed commented 1 year ago

Thanks for looking into this. I cannot poke around on the production machine but I am testing on:

nginx 1.25.0 Moodle 4.1.3 mysql 5.7.42 PHP 8.1.18 Ubuntu 22

Looking into it further it looks like system and category managers are displaying.

drachels commented 1 year ago

You still have not mentioned which version of Diary you are using. Every version of Moodle I have for the released current version of Diary, v3.7.4, shows ONLY people enrolled in the course when I go to view the entries. If your real problem is seeing system and category managers, then use visible groups. Put students in one or more groups, and the system and category managers in a mgmt group.

Note that I deliberately include admin and management people in the listing because of some of the capabilities needed for Diary. e.g. download all entries.

patriclougheed commented 1 year ago

This is with 3.7.4.

Can there be an option to not show empty entries? At least have a unique CSS style for those empty divs so that they can be hidden.

drachels commented 1 year ago

I will add these requests to my TODO list, but I have a bunch of other stuff ahead of these.

drachels commented 11 months ago

Sorry to take so long to get to this, but the Diary master branch now has a preference selector for each diary activity that allows a teacher, manager, or admin to hide users with, No Entry. If one wants to try it out, it can be cherry picked by just copying report.php file and the language file diary.php. You will probably then need to go to Site administration > Language > Language settings, then just click the save button to update your language strings.

I need to do some more testing to make sure it works in all the supported versions of Moodle v3.7 thru 4.3, but it should be in the next release, if testing goes well.

drachels commented 10 months ago

The capability to "not show empty entries" is now included in the v3.7.7 release, so this issue is closed.