Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
cdipe opened this issue Jun 14, 2021 · 12 comments

Comments

@cdipe
Copy link

cdipe commented Jun 14, 2021

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
Copy link
Author

cdipe commented Jun 14, 2021

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
Copy link
Owner

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
Copy link
Author

cdipe commented Jun 15, 2021

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
Copy link
Author

cdipe commented Jun 23, 2021

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
Copy link
Owner

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

@danmarsden
Copy link
Owner

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
Copy link
Author

cdipe commented Jun 23, 2021

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

@danmarsden
Copy link
Owner

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
Copy link

on8pz commented Sep 15, 2021

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_by_author.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
Copy link
Owner

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

@davefoord
Copy link

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
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants