Duplicate Attendance activities in 3.10

Duplicate Attendance activities in 3.10

by Eric Phetteplace -
Number of replies: 3

Hi, we just upgraded a testing server to Moodle version 3.10.4 and started testing. We have both the Attendance activity mod_attendance and the block block_attendance installed. I've noticed that there are duplicate instances of Attendance listed wherever all activities are shown e.g. under Site administration / Plugins / Activity modules / Manage activities and also under Site administration / Courses / Activity chooser / Recommended activities. The activity chooser will also show our instructors the duplicates, it's not just on the admin side. Here's an example screenshot:

two instances of Attendance listed where you hide activities in Moodle admin

We only have one instance of the mod_attendance plugin installed (I assume Moodle makes it impossible to install multiple of the same plugin anyway), so this is very mysterious to me. Is this a bug with Moodle 3.10 or with the plugin? Has anyone else witnessed this behavior?

You can see our workaround—we simply hid one of the activity instances—but it's still strange.

Average of ratings: -
In reply to Eric Phetteplace

Re: Duplicate Attendance activities in 3.10

by Dan Marsden -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators
someone must have copied the "attendance" plugin and renamed it to something like "attendance2" but not adjusted the lang string pluginname which is set to "attendance" - it will probaly appear in the mod folder on your server too.

If you hover over the "uninstall" link of both plugins you'll probably find the correct one has uninstall=mod_attendance in the url, but the other has a slightly different name like mod_attendance2 or mod_someotherpluginname

.. theoretically on some file systems "attendance" is different from "Attendance" - I wonder if somehow you've also got it installed twice with different case use in the directory name.
In reply to Dan Marsden

Re: Duplicate Attendance activities in 3.10

by Eric Phetteplace -
There wasn't another Attendance plugin on disk anywhere and the settings/uninstall links both pointed to the exact same URL. Interestingly, if I try to show or hide the second Attendance plugin, only the first one is affected. Must be somehow related to how the /admin/modules.php page is coded (looks for the first plugin with a matching name and changes its visibility).

I looked at the "modules" database table and found the duplicate there: we had two modules with name = 'attendance'. One of them (the second, the one with higher id number) had no associated instances in the "course_modules" table. Given that this is our test server, I went ahead and deleted the second row out of the database. Everything seems normal now, no adverse effects yet. My guess is the attendance plugin installation must have somehow been interrupted in the past and the database step was duplicated. It's strange it was only noticeable on 3.10.
In reply to Eric Phetteplace

Re: Duplicate Attendance activities in 3.10

by Dan Marsden -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators
weird - I haven't seen this before - not sure how it could have occurred.