Moodle
  1. Moodle
  2. MDL-35653

Wiki module does not work if you activate the force format option

    Details

    • Testing Instructions:
      Hide

      Test pre-requisites

      • Two groups with students in each group.

      Test steps

      1. Create a wiki activity, set to collaborative, force format, separate groups.
      2. Click save and view.
        • You should be taken to a page for editing the first wiki.
      3. Add content to this page and save the wiki.
      4. Now Change to another group.
        • You should now be directed to an edit screen with the same title, but for a different group.
      5. Cancel creating a page (Just click on any other link to navigate away).
      6. Click the link for a new page. [Navigation ► Current course ► {course name}

        {topic / week / whatever}

        {wiki name}

        ► New].

        • You should now see a page that lets you change the title and the group.
      7. Log in as a student.
      8. Go to the wiki activity.
      9. Being the first to create a page for the group you will be shown to the opening page (what ever you defined the page as).
      10. Create some content and save.
      11. Create a new page [Navigation ► Home ► Current course ► [course name][Topic][Name of the wiki activity] ► New].
        • You should be able to change the page title.
      12. Change the name and create a page.
      13. Create a link in a page (edit one of the existing pages you just created). Links are created by putting a word or sentence in double brackets [[Something]].
      14. The link should show up as red (unless you created a link to an existing page).
      15. Click on the link.
        • You should be directed to a page to edit content with a title of the link that you created.
      16. Log out and log in as a student from a different group. Follow the above steps (7 - 15).
      17. Test other basic functionality for regressions.
      Show
      Test pre-requisites Two groups with students in each group. Test steps Create a wiki activity, set to collaborative, force format, separate groups. Click save and view. You should be taken to a page for editing the first wiki. Add content to this page and save the wiki. Now Change to another group. You should now be directed to an edit screen with the same title, but for a different group. Cancel creating a page (Just click on any other link to navigate away). Click the link for a new page. [Navigation ► Current course ► {course name} ► {topic / week / whatever} ► {wiki name} ► New]. You should now see a page that lets you change the title and the group. Log in as a student. Go to the wiki activity. Being the first to create a page for the group you will be shown to the opening page (what ever you defined the page as). Create some content and save. Create a new page [Navigation ► Home ► Current course ► [course name] ► [Topic] ► [Name of the wiki activity] ► New]. You should be able to change the page title. Change the name and create a page. Create a link in a page (edit one of the existing pages you just created). Links are created by putting a word or sentence in double brackets [ [Something] ]. The link should show up as red (unless you created a link to an existing page). Click on the link. You should be directed to a page to edit content with a title of the link that you created. Log out and log in as a student from a different group. Follow the above steps (7 - 15). Test other basic functionality for regressions.
    • Affected Branches:
      MOODLE_23_STABLE
    • Fixed Branches:
      MOODLE_22_STABLE, MOODLE_23_STABLE, MOODLE_24_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      wip-MDL-35653-master

      Description

      NB! This is a duplicate of an already closed issue but unfortunately, this issue still appeared in 2.3.2+

      Steps to reproduce:
      1.Make sure, you have different groups on course with couple of student in it.
      2.Create a wiki (collaborative, with forceformat option, groups option:separate)
      3.As teacher add some content to - All participants
      4.(first bug as teacher) - try to change group, it redirects you back to All participants edit view
      5.(second bug as student) - log in as some student from a group, try to view/edit the wiki(you'll get: You can not edit this page)

      I tried it in - http://qa.moodle.net

      Only if you untick the force format option, it gives teacher/students the option to create pages for groups.

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            Tõnis Tartes added a comment -

            This patch should fix this.

            Show
            Tõnis Tartes added a comment - This patch should fix this.
            Hide
            Tõnis Tartes added a comment -

            Linked issue

            Show
            Tõnis Tartes added a comment - Linked issue
            Hide
            Michael de Raadt added a comment -

            Thanks for reporting that and providing a patch.

            Show
            Michael de Raadt added a comment - Thanks for reporting that and providing a patch.
            Hide
            Yvonne Hamilton added a comment -

            We have this issue on Moodle 2.1.8 also.
            We wanted to do a minor upgrade to fix wiki issues but found this issue broke existing wiki's also with format forced if no content existed for a group.

            Show
            Yvonne Hamilton added a comment - We have this issue on Moodle 2.1.8 also. We wanted to do a minor upgrade to fix wiki issues but found this issue broke existing wiki's also with format forced if no content existed for a group.
            Hide
            DANIEL BERNAL YHAMA added a comment - - edited

            http://tracker.moodle.org/browse/MDL-36288

            Ubuntu Server 11.10 64 bits.

            Moodle 2.3.2+ (Build: 20121018)
            Mysql 5.1.63.0.0.11.10.1
            PHP 5.3.6.13.3.9

            When a user has already created and has used his wiki without problem, the bug start when he tries to check the wiki of another user which is empty and you receive the following error:

            Debug info:
            Error code: nocontent
            Stack trace:
            • line 467 of / lib / setuplib.php: moodle_exception thrown
            • line 200 of / mod / wiki / view.php: call to print_error ()

            After that, it's impossible to the user to re-enter to his own wiki and moodle shows the following error:

            Debug info: Duplicate entry '657-0-9078' for key 'mdl_wikisubw_wikgrouse_uix'
            INSERT INTO mdl_wiki_subwikis (wikiid,groupid,userid) VALUES(?,?,?)
            [array (
            0 => '657',
            1 => '0',
            2 => 9078,
            )]
            Error code: dmlwriteexception

            Stack trace:

            line 410 of /lib/dml/moodle_database.php: dml_write_exception thrown
            line 1050 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
            line 1092 of /lib/dml/mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->insert_record_raw()
            line 104 of /mod/wiki/locallib.php: call to mysqli_native_moodle_database->insert_record()
            line 952 of /mod/wiki/pagelib.php: call to wiki_add_subwiki()
            line 115 of /mod/wiki/create.php: call to page_wiki_create->create_page()

            Show
            DANIEL BERNAL YHAMA added a comment - - edited http://tracker.moodle.org/browse/MDL-36288 Ubuntu Server 11.10 64 bits. Moodle 2.3.2+ (Build: 20121018) Mysql 5.1.63.0.0.11.10.1 PHP 5.3.6.13.3.9 When a user has already created and has used his wiki without problem, the bug start when he tries to check the wiki of another user which is empty and you receive the following error: Debug info: Error code: nocontent Stack trace: • line 467 of / lib / setuplib.php: moodle_exception thrown • line 200 of / mod / wiki / view.php: call to print_error () After that, it's impossible to the user to re-enter to his own wiki and moodle shows the following error: Debug info: Duplicate entry '657-0-9078' for key 'mdl_wikisubw_wikgrouse_uix' INSERT INTO mdl_wiki_subwikis (wikiid,groupid,userid) VALUES(?,?,?) [array ( 0 => '657', 1 => '0', 2 => 9078, )] Error code: dmlwriteexception Stack trace: line 410 of /lib/dml/moodle_database.php: dml_write_exception thrown line 1050 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end() line 1092 of /lib/dml/mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->insert_record_raw() line 104 of /mod/wiki/locallib.php: call to mysqli_native_moodle_database->insert_record() line 952 of /mod/wiki/pagelib.php: call to wiki_add_subwiki() line 115 of /mod/wiki/create.php: call to page_wiki_create->create_page()
            Hide
            Michael de Raadt added a comment -

            Thanks for persisting with this, guys.

            I've bumped this issue. Hopefully we can resolve this soon.

            Show
            Michael de Raadt added a comment - Thanks for persisting with this, guys. I've bumped this issue. Hopefully we can resolve this soon.
            Hide
            Huy Hoang added a comment -

            please add 2.2.5 as an affected version (reported as MDL-36313).

            The patch provided by Tõnis is safe as it's quite conservative with the condition checking, but I think it might increase the coupling with create.php (as the condition specifically matches the set up by create.php)

            If $this->gid is available, we probably should make use of it regardless of how it was set to prevent recurring problem if there is a different scenario in the future. Thus, I prefer a more generic approach:

            ----------------------------------
            if (isset($data->groupinfo))

            { $groupid = $data->groupinfo; }

            else if (!empty($this->gid))

            { $groupid = $this->gid; }

            else

            { $groupid = '0'; }

            ----------------------------------

            Show
            Huy Hoang added a comment - please add 2.2.5 as an affected version (reported as MDL-36313 ). The patch provided by Tõnis is safe as it's quite conservative with the condition checking, but I think it might increase the coupling with create.php (as the condition specifically matches the set up by create.php) If $this->gid is available, we probably should make use of it regardless of how it was set to prevent recurring problem if there is a different scenario in the future. Thus, I prefer a more generic approach: ---------------------------------- if (isset($data->groupinfo)) { $groupid = $data->groupinfo; } else if (!empty($this->gid)) { $groupid = $this->gid; } else { $groupid = '0'; } ----------------------------------
            Hide
            Jacqui Nicol added a comment -

            We are experiencing the same behaviour in 2.2.3. Can a fix for previous versions also be supplied.

            Show
            Jacqui Nicol added a comment - We are experiencing the same behaviour in 2.2.3. Can a fix for previous versions also be supplied.
            Hide
            Damyon Wiese added a comment -

            I had a dicussion with Adrian and we decided that taking the teachers to the create page every time was not necessary so he will update the patch. (Everything else from the peer review was fine - I'll post a checklist once we have the new patch).

            Show
            Damyon Wiese added a comment - I had a dicussion with Adrian and we decided that taking the teachers to the create page every time was not necessary so he will update the patch. (Everything else from the peer review was fine - I'll post a checklist once we have the new patch).
            Hide
            Adrian Greeve added a comment -

            Thanks Damyon,

            I've uploaded the new patch and updated the testing instructions.

            Show
            Adrian Greeve added a comment - Thanks Damyon, I've uploaded the new patch and updated the testing instructions.
            Hide
            Damyon Wiese added a comment -

            Thumbs up from me - thanks Adrian,

            [Y] Syntax
            [-] Output
            [Y] Whitespace
            [-] Language
            [-] Databases
            [Y] Testing
            [-] Security
            [-] Documentation
            [Y] Git

            I've tested on master and 22. Sending for integration review.

            Show
            Damyon Wiese added a comment - Thumbs up from me - thanks Adrian, [Y] Syntax [-] Output [Y] Whitespace [-] Language [-] Databases [Y] Testing [-] Security [-] Documentation [Y] Git I've tested on master and 22. Sending for integration review.
            Hide
            Sam Hemelryk added a comment -

            Thanks Adrian, this has been integrated now.

            Show
            Sam Hemelryk added a comment - Thanks Adrian, this has been integrated now.
            Hide
            Sam Hemelryk added a comment -

            Tested during integration review and passed.

            Show
            Sam Hemelryk added a comment - Tested during integration review and passed.
            Hide
            Eloy Lafuente (stronk7) added a comment -

            Did you know that your awesome changes are the last ones landing to CVS?

            After 11 years, 2 months and 8 days... it's ended, died, closed, kaputt. Big thanks to it, has served us really well.

            Closing this as fixed, many thanks!

            Show
            Eloy Lafuente (stronk7) added a comment - Did you know that your awesome changes are the last ones landing to CVS? After 11 years, 2 months and 8 days... it's ended, died, closed, kaputt. Big thanks to it, has served us really well. Closing this as fixed, many thanks!

              People

              • Votes:
                11 Vote for this issue
                Watchers:
                11 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: