Moodle
  1. Moodle
  2. MDL-21265

A Teacher type wiki that uses Visible groups contains a viewing bug

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.9.5, 1.9.7
    • Fix Version/s: 1.8.12, 1.9.8
    • Component/s: None
    • Labels:
      None
    • Database:
      MySQL
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_18_STABLE, MOODLE_19_STABLE
    • Rank:
      26544

      Description

      Wikis set to Teacher type using Visible groups should allow the teacher to create a wiki instance for each group. The visible group attribute should then allow all group members to see all of these wiki instances. This works as intended ONLY when the teacher creates a wiki entry for each group. If the teacher has not yet created a wiki for a group, let's say Group 2,, then Group 2 will be unable to read any of the other wiki entries. They will see the attached message when they visit this wiki activity. Once the teacher creates a wiki entry for their group then everything works as intended.

      In this scenario, I expect all groups should be able to see all of the wikis a teacher has created for each group regardless if the teacher failed to create a wiki entry for every group.

      1. MDL-21265.patch.txt
        1 kB
        Eloy Lafuente (stronk7)

        Activity

        Hide
        Charles Fulton added a comment -

        The current version of view.php tests for a default entry when calling wiki_get_other_wikis(), so in this case it will always fail. The quick and dirty answer is to eliminate that part of the test, and I've created a patch against 1.9.7. The better answer (probably) is creating a default entry point for this particular situation.

        Show
        Charles Fulton added a comment - The current version of view.php tests for a default entry when calling wiki_get_other_wikis(), so in this case it will always fail. The quick and dirty answer is to eliminate that part of the test, and I've created a patch against 1.9.7. The better answer (probably) is creating a default entry point for this particular situation.
        Hide
        Charles Fulton added a comment -

        This reverts (in part) this revision: http://cvs.moodle.org/moodle/mod/wiki/view.php?r1=1.57&r2=1.58. It's not clear to me what problem this resolved.

        Show
        Charles Fulton added a comment - This reverts (in part) this revision: http://cvs.moodle.org/moodle/mod/wiki/view.php?r1=1.57&r2=1.58 . It's not clear to me what problem this resolved.
        Hide
        Eloy Lafuente (stronk7) added a comment -

        Hi Charles,

        I've been looking at code and trying to reproduce this and haven't been able to do so. Here there are my exact steps (just to know if I'm doing something different).

        1) Create course with 2 groups (G1 and G2).
        2) Assign 1 user to each one (U1 and U2).
        3) Create wiki in teacher mode and with visible groups
        4) Change entry of G1 to "this is G1 initial page". Leave the G2 one empty.
        4) Log as U1, I can see the dropdown to navigate to G1 (with content) and G2 (empty) entries
        5) Log as U2, I can see the dropdown to navigate to G1 (with content) and G2 (empty) entries

        So, users from any group are able to see the dropdown, no matter if the page has been saved for all groups or no.

        Can you, plz, post more detailed steps to reproduce the problem?

        TIA and ciao

        Show
        Eloy Lafuente (stronk7) added a comment - Hi Charles, I've been looking at code and trying to reproduce this and haven't been able to do so. Here there are my exact steps (just to know if I'm doing something different). 1) Create course with 2 groups (G1 and G2). 2) Assign 1 user to each one (U1 and U2). 3) Create wiki in teacher mode and with visible groups 4) Change entry of G1 to "this is G1 initial page". Leave the G2 one empty. 4) Log as U1, I can see the dropdown to navigate to G1 (with content) and G2 (empty) entries 5) Log as U2, I can see the dropdown to navigate to G1 (with content) and G2 (empty) entries So, users from any group are able to see the dropdown, no matter if the page has been saved for all groups or no. Can you, plz, post more detailed steps to reproduce the problem? TIA and ciao
        Hide
        Jason Alley added a comment -

        Hi Eloy,

        I posted this bug and then made it known to Charles. The steps you list here look exactly like what I did to produce this issue. The only thing I want to be clear about is that the Wiki is set to Teacher type; not something created by the Teacher role (is was actually created by me, which is site-wide admin). Also, if at any time you opened the Group 2 wiki, even without posting content, it will display as intended.

        -Jason

        Show
        Jason Alley added a comment - Hi Eloy, I posted this bug and then made it known to Charles. The steps you list here look exactly like what I did to produce this issue. The only thing I want to be clear about is that the Wiki is set to Teacher type; not something created by the Teacher role (is was actually created by me, which is site-wide admin). Also, if at any time you opened the Group 2 wiki, even without posting content, it will display as intended. -Jason
        Hide
        Eloy Lafuente (stronk7) added a comment -

        Hi Jason,

        > to be clear about is that the Wiki is set to Teacher type; not something created by the Teacher role

        Yes, yes. I did my test above as admin too, the "teacher mode" above means "teacher wiki type".

        > Also, if at any time you opened the Group 2 wiki, even without posting content, it will display as intended.

        Uhm, I'm lost now. So then... where is the problem? My G2 user (U2) is perfectly able to see the G1 entry without problems. What do you get instead? (note that in your initial description ob the bug you comment about one - missing - attachment. Hehe, I'm lost now, definitively.

        Ciao

        Show
        Eloy Lafuente (stronk7) added a comment - Hi Jason, > to be clear about is that the Wiki is set to Teacher type; not something created by the Teacher role Yes, yes. I did my test above as admin too, the "teacher mode" above means "teacher wiki type". > Also, if at any time you opened the Group 2 wiki, even without posting content, it will display as intended. Uhm, I'm lost now. So then... where is the problem? My G2 user (U2) is perfectly able to see the G1 entry without problems. What do you get instead? (note that in your initial description ob the bug you comment about one - missing - attachment. Hehe, I'm lost now, definitively. Ciao
        Hide
        Jason Alley added a comment -

        >> Also, if at any time you opened the Group 2 wiki, even without posting content, it will display as intended.

        > Uhm, I'm lost now. So then... where is the problem? My G2 user (U2) is perfectly able to see the G1 entry without problems. What do you get instead? (note that in your initial description ob the bug you comment about one - missing - attachment. Hehe, I'm lost now, definitively.

        The problem is that a teacher may not open the other group's wiki initially, thereby leaving that other group unable to view any of the other wikis including their own (even if it's blank). However, as soon as the teacher views the other group's wiki then the other group is able to view their's (even if it's void of content) as well as the others'. The problem as we defined is that even if a teacher never views the other wiki the students from the other group should still be able to see the other group's work. The bug does not permit this.

        Show
        Jason Alley added a comment - >> Also, if at any time you opened the Group 2 wiki, even without posting content, it will display as intended. > Uhm, I'm lost now. So then... where is the problem? My G2 user (U2) is perfectly able to see the G1 entry without problems. What do you get instead? (note that in your initial description ob the bug you comment about one - missing - attachment. Hehe, I'm lost now, definitively. The problem is that a teacher may not open the other group's wiki initially, thereby leaving that other group unable to view any of the other wikis including their own (even if it's blank). However, as soon as the teacher views the other group's wiki then the other group is able to view their's (even if it's void of content) as well as the others'. The problem as we defined is that even if a teacher never views the other wiki the students from the other group should still be able to see the other group's work. The bug does not permit this.
        Hide
        Eloy Lafuente (stronk7) added a comment -

        Attaching patch that causes students to see in the drop-down all the groups that have their wiki initialized and, at the same time, proceed with initialization of the own group, so will be visible for other groups.

        Right now it's highly complex to allow all the groups to be showed to students (can cause other regressions), so note that only groups with initialized wiki will be available in the drop-down.

        Plz, test and feedback if possible.

        Note: "initialized wiki" doesn't mean the wiki has contents, just it has been visited at least once by any user (teacher or student). Before the patch only teachers were able to initialize each group wiki. Now any user will, so the drop-down will be available sooner.

        Show
        Eloy Lafuente (stronk7) added a comment - Attaching patch that causes students to see in the drop-down all the groups that have their wiki initialized and, at the same time, proceed with initialization of the own group, so will be visible for other groups. Right now it's highly complex to allow all the groups to be showed to students (can cause other regressions), so note that only groups with initialized wiki will be available in the drop-down. Plz, test and feedback if possible. Note: "initialized wiki" doesn't mean the wiki has contents, just it has been visited at least once by any user (teacher or student). Before the patch only teachers were able to initialize each group wiki. Now any user will, so the drop-down will be available sooner.
        Hide
        Eloy Lafuente (stronk7) added a comment -

        ping! anyone has been able to test the patch above?

        Show
        Eloy Lafuente (stronk7) added a comment - ping! anyone has been able to test the patch above?
        Hide
        Jason Alley added a comment -

        Eloy, I don't deploy patches, but Charle's fix worked great. I'm wondering what you did differently to resolved this.

        Show
        Jason Alley added a comment - Eloy, I don't deploy patches, but Charle's fix worked great. I'm wondering what you did differently to resolved this.
        Hide
        Charles Fulton added a comment -

        Hi Eloy, I tested this against 1.9.7 and it seemed fine and a more elegant solution. I don't see any downsides to this fix.

        Show
        Charles Fulton added a comment - Hi Eloy, I tested this against 1.9.7 and it seemed fine and a more elegant solution. I don't see any downsides to this fix.
        Hide
        Eloy Lafuente (stronk7) added a comment -

        Hi Jason,

        I contacted Sam Marshall to ask about the reasons for his commit and he remembered that passing a null entry to some functions can lead to big problems in wiki (from innocent notices/warnings to worse effects), so he encouraged me to try to fix it without deleting the requirement of the entry already existing.

        After a lot of tracing in the module code (wiki is really complex and imbricated) I arrived to my solution that causes more or less the same effect: allow students to see pages from other groups no matter if their own page hasn't been created. And I did it without taking out the entry check-condition (as Sam recommended). That way we are minimizing risks in the middle of one stable release.

        Uff, it's really complex to explain, hehe. Thanks for the feedback!

        Hi Charles,

        thanks for the tests and feedback. I think I'll commit this right now!

        Ciao

        Show
        Eloy Lafuente (stronk7) added a comment - Hi Jason, I contacted Sam Marshall to ask about the reasons for his commit and he remembered that passing a null entry to some functions can lead to big problems in wiki (from innocent notices/warnings to worse effects), so he encouraged me to try to fix it without deleting the requirement of the entry already existing. After a lot of tracing in the module code (wiki is really complex and imbricated) I arrived to my solution that causes more or less the same effect: allow students to see pages from other groups no matter if their own page hasn't been created. And I did it without taking out the entry check-condition (as Sam recommended). That way we are minimizing risks in the middle of one stable release. Uff, it's really complex to explain, hehe. Thanks for the feedback! Hi Charles, thanks for the tests and feedback. I think I'll commit this right now! Ciao
        Hide
        Eloy Lafuente (stronk7) added a comment -

        Done, fix applied to 1.8 and 1.9. Resolving as fixed. Ciao

        Show
        Eloy Lafuente (stronk7) added a comment - Done, fix applied to 1.8 and 1.9. Resolving as fixed. Ciao
        Hide
        Jason Alley added a comment -

        Thanks for looking at this more thoroughly, Elon and Charles.

        Show
        Jason Alley added a comment - Thanks for looking at this more thoroughly, Elon and Charles.

          People

          • Votes:
            7 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: