danmarsden / moodle-mod_dialogue

Dialogue Module for Moodle
27 stars 35 forks source link

All threads from different dialogues in different courses visible in every Dialogue #91

Closed cdipe closed 2 years ago

cdipe commented 3 years ago

Hi, we just upgraded to moodle 3.9.7 and using dialogue 3.4 2017111300, and suddenly the users can see all their dialogue threads from any dialogue, in any dialogue, in any course. They start a dialogue in one course and can see it in another dialogue in another course.

This doesn't happen to moodle administrators, only teacher roles and students.

It's a big problem, since we didn't discover this until after the upgrade of the production environment.

https://moodle.org/mod/forum/discuss.php?d=423447

cdipe commented 3 years ago

Even stranger: When giving the right mod/dialogue:viewany to the roles, this makes the user see only the coversations in that dialogue, not from other Dialogues. But the intended function is also added, to see any conversation in that Dialogue.

danmarsden commented 3 years ago

I haven't been able to reproduce this - please let me know if you work out the conditions that allow me to reproduce this with a fresh install of dialogue.

thanks!

cdipe commented 3 years ago

I installed 3.9.7 locally om my mac and cannot reproduce. We'll investigate our live sites further. Dialogue was working fine in 3.8.6, that we upgraded from. Any ideas where to start investigating?

cdipe commented 3 years ago

Hi! We had a moodle partner helping us with the problem, and they made this report and code changes. That solved our problem. There is a bug in the plugin Dialog[3].pdf

danmarsden commented 3 years ago

Great! - any chance that Moodle partner could submit a Pull request with the change? - not ideal supplying patches in pdf files...

danmarsden commented 3 years ago

I also note that the pdf suggests that this plugin hasn't received any updates since 2017, which is obviously incorrect and they didn't even look at the github codebase...

cdipe commented 3 years ago

@danmarsden I'll ask the Moodle partner if they will submit a pull request, I don't know how to do it properly.

danmarsden commented 3 years ago

HI @cdipe - I'm closing this as I cannot reproduce this with the latest code - if you can find a way for me to reproduce this with the latest version including the steps required to do this please let me know and I'll take another look.

on8pz commented 2 years ago

Same problem on moodle 3.11 with the latest mod_dialogue at this time (3.11.1) Steps to reproduce: Login with account with teacher role in course A and course B. (Users with admin roles do not see the error. Also do not use the 'login as' functionality since you will not see the problem. Log in with teacher account without admin privileges)

Go to course A Add dialogue activity in course A Add conversation in the dialogue activity in course A Go to course B Add dialogue activity in course B Open just added dialogue activity in course B -> conversation from course A will also be visible here.

Code change required to fix this: In _classes/conversations_byauthor.php on line 90 Replace WHERE dp.userid = :userid) isparticipant with WHERE dp.userid = :userid AND dp.dialogueid=:dialogueid) isparticipant

Add below line 93: $this->params['dialogueid'] = $this->dialogue->activityrecord->id;

Disclaimer: This change was not extensively tested yet, but it seems to fix the problem for our 400+ teachers.

danmarsden commented 2 years ago

Hi @on8pz thanks for the info - feel free to submit a PR with the change and I can take a look.

davefoord commented 1 year ago

Hi Dan - I have installed the 4.0 version of the plugin on my 3.11 Moodle and the same problem is occurring, so doesn't appear to have fixed it, which is a shame. I am not planning to upgrade the Moodle to 4.x until next summer.

Is it worth me trying to edit the code as per the suggestions by on8pz?

danmarsden commented 1 year ago

hmmm - that doesn't sound right... the Moodle 4.0 version of this plugin has a "requires" version set to Moodle 4.0 and higher, so it shouldn't let you install it on your Moodle 3.11 site at all. I'll see if I can find some time to backport the patch to the 3.11 branch sometime today.