Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-31188

Wiki groups selection does not work

    XMLWordPrintable

    Details

    • Database:
      MySQL
    • Workaround:
      Hide

      Checking the code i found that group change in view redirects the page to URL containing parameter "gid",
      but the code in /mod/wiki/view.php line 45 actually reads the group ID from parameter "group".

      After little investigation seems, that this fixes the problem:

      --- a/mod/wiki/view.php
      +++ b/mod/wiki/view.php
      @@ -209,7 +209,7 @@ if ($id) {
       
           // Checking is there is a page with this title. If it does not exists, redirect to first page
           if (!$page = wiki_get_page_by_title($subwiki->id, $title)) {
      -        $params = array('wid' => $wiki->id, 'gid' => $gid, 'uid' => $uid, 'title' => $wiki->firstpagetitle);
      +        $params = array('wid' => $wiki->id, 'group' => $gid, 'uid' => $uid, 'title' => $wiki->firstpagetitle);
               $url = new moodle_url('/mod/wiki/view.php', $params);
               redirect($url);
           }
       

      But after this code change i can't switch back to "All participants" (always the group stays selected instead)...

      Show
      Checking the code i found that group change in view redirects the page to URL containing parameter "gid", but the code in /mod/wiki/view.php line 45 actually reads the group ID from parameter "group". After little investigation seems, that this fixes the problem: --- a/mod/wiki/view.php +++ b/mod/wiki/view.php @@ -209,7 +209,7 @@ if ($id) { // Checking is there is a page with this title. If it does not exists, redirect to first page if (!$page = wiki_get_page_by_title($subwiki->id, $title)) { - $params = array('wid' => $wiki->id, 'gid' => $gid, 'uid' => $uid, 'title' => $wiki->firstpagetitle); + $params = array('wid' => $wiki->id, 'group' => $gid, 'uid' => $uid, 'title' => $wiki->firstpagetitle); $url = new moodle_url('/mod/wiki/view.php', $params); redirect($url); }   But after this code change i can't switch back to "All participants" (always the group stays selected instead)...
    • Affected Branches:
      MOODLE_21_STABLE

      Description

      Selecting groups in wiki view page (/mod/wiki/view.php) does not change the wiki content.
      Groups selection works in files tab (/mod/wiki/files.php), but not in view.

      Replication steps:

      1. Create wiki with groups
      2. Add wiki content under some group
      3. Go to wiki view page
      4. Try to change the group and see the added content – group does not change

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              abgreeve Adrian Greeve
              Reporter:
              mangus Mart Mangus
              Participants:
              Component watchers:
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: