Moodle
  1. Moodle
  2. MDL-29909

fatal error on wiki with seperate groups and individual mode when logged in as student

    Details

      Description

      Coding error detected, it must be fixed by a programmer: PHP catchable fatal error
       
      More information about this error
      Debug info: Argument 3 passed to core_renderer::single_select() must be an array, null given, called in /var/www/moodle/mod/wiki/renderer.php on line 404 and defined
      Stack trace:
       
          line 359 of /lib/setuplib.php: coding_exception thrown
          line 1158 of /lib/outputrenderers.php: call to default_error_handler()
          line 404 of /mod/wiki/renderer.php: call to core_renderer->single_select()
          line 284 of /mod/wiki/pagelib.php: call to mod_wiki_renderer->wiki_print_subwiki_selector()
          line 279 of /mod/wiki/view.php: call to page_wiki_view->print_header()

        Gliffy Diagrams

        1. fixed-MDL-29909.patch
          0.6 kB
          Iurii Kucherov
        2. MDL-29909.patch
          0.6 kB
          Iurii Kucherov

          Issue Links

            Activity

            Hide
            DANIEL BERNAL YHAMA added a comment -

            I have the same error. Do you found the solution?

            Show
            DANIEL BERNAL YHAMA added a comment - I have the same error. Do you found the solution?
            Hide
            Michael de Raadt added a comment -

            Bumping this as it has been duplicated and looks pretty serious.

            Show
            Michael de Raadt added a comment - Bumping this as it has been duplicated and looks pretty serious.
            Hide
            Iurii Kucherov added a comment - - edited

            This problem appears when user that isn't in any group try to view wiki with seperate groups and individual mode.
            So here is a patch that fix this problem.

            diff --git a/mod/wiki/renderer.php b/mod/wiki/renderer.php
            index 31594b2..bf3d53e 100755
            --- a/mod/wiki/renderer.php
            +++ b/mod/wiki/renderer.php
            @@ -390,6 +390,9 @@ class mod_wiki_renderer extends plugin_renderer_base {
                                 }
                             } else {
                                 $group = groups_get_group($subwiki->groupid);
            +                    if (!$group) {
            +                        return ;
            +                    }
                                 $users = groups_get_members($subwiki->groupid);
                                 foreach ($users as $user) {
                                     $options[$group->id][$group->name][$group->id . '-' . $user->id] = fullname($user);
            
            

            Show
            Iurii Kucherov added a comment - - edited This problem appears when user that isn't in any group try to view wiki with seperate groups and individual mode. So here is a patch that fix this problem. diff --git a/mod/wiki/renderer.php b/mod/wiki/renderer.php index 31594b2..bf3d53e 100755 --- a/mod/wiki/renderer.php +++ b/mod/wiki/renderer.php @@ -390,6 +390,9 @@ class mod_wiki_renderer extends plugin_renderer_base { } } else { $group = groups_get_group($subwiki->groupid); + if (!$group) { + return ; + } $users = groups_get_members($subwiki->groupid); foreach ($users as $user) { $options[$group->id][$group->name][$group->id . '-' . $user->id] = fullname($user);
            Hide
            Charles Fulton added a comment -

            Verified on current master and patch works fine. Iurii, I've pushed your patch into my github for now.

            Show
            Charles Fulton added a comment - Verified on current master and patch works fine. Iurii, I've pushed your patch into my github for now.
            Hide
            Dan Poltawski added a comment -

            Hmm, the code is fine but I wonder are we looking deep enough at the issue - is there problem elsewhere which means it is getting to this stage?

            I have heard of other related wiki groups mode issues so I think this might require more investigation.

            Show
            Dan Poltawski added a comment - Hmm, the code is fine but I wonder are we looking deep enough at the issue - is there problem elsewhere which means it is getting to this stage? I have heard of other related wiki groups mode issues so I think this might require more investigation.
            Hide
            Dan Poltawski added a comment -

            Linking to related issue MDL-30478 which makes me suspicious that we need to look more deeply at this issue.

            Show
            Dan Poltawski added a comment - Linking to related issue MDL-30478 which makes me suspicious that we need to look more deeply at this issue.
            Hide
            Howard Miller added a comment -

            Adding the partner label as it is currently a blocker for one of our clients.

            Show
            Howard Miller added a comment - Adding the partner label as it is currently a blocker for one of our clients.
            Hide
            Howard Miller added a comment -

            cherry-picked the change to 2.2 and (so far) it is working with no problems.

            Show
            Howard Miller added a comment - cherry-picked the change to 2.2 and (so far) it is working with no problems.
            Hide
            Dan Poltawski added a comment -

            Well, lets try and get this integrated then as its a step forward at least.

            Charles, are you able to rebase your patch? I'll do if not.

            Show
            Dan Poltawski added a comment - Well, lets try and get this integrated then as its a step forward at least. Charles, are you able to rebase your patch? I'll do if not.
            Hide
            Charles Fulton added a comment -

            Rebased.

            Show
            Charles Fulton added a comment - Rebased.
            Hide
            Sam Hemelryk added a comment -

            Thanks Charles, this has been integrated now

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

            Charles if you are around could you please improve the testing instructions.
            I think they really need to be clearer and have a decisive outcome.

            Cheers
            Sam

            Show
            Sam Hemelryk added a comment - Charles if you are around could you please improve the testing instructions. I think they really need to be clearer and have a decisive outcome. Cheers Sam
            Hide
            Charles Fulton added a comment - - edited

            Sam, I went to try to reproduce this to remind myself of the issue and couldn't. I'm wondering now if it got resolved by MDL-30478. Howard, what version are your clients running?

            I created a 2.3 instance, reverted MDL-30478, got it to break, re-added MDL-30478, and couldn't get it to break. I think this is resolved. If you want to repeat, just create an individual wiki with separate groups in a course with groups. Have a student access their wiki and create the first page. It'll crash on display.

            Show
            Charles Fulton added a comment - - edited Sam, I went to try to reproduce this to remind myself of the issue and couldn't. I'm wondering now if it got resolved by MDL-30478 . Howard, what version are your clients running? I created a 2.3 instance, reverted MDL-30478 , got it to break, re-added MDL-30478 , and couldn't get it to break. I think this is resolved. If you want to repeat, just create an individual wiki with separate groups in a course with groups. Have a student access their wiki and create the first page. It'll crash on display.
            Hide
            Rajesh Taneja added a comment -

            Works Great,
            Thanks Charles and everyone.

            FYI:
            I tried removing the patch and as a student tried to save page. Got following error:

            Debug info: Argument 3 passed to core_renderer::single_select() must be an array, null given, called in /var/www/im/mod/wiki/renderer.php on line 407 and defined
            Error code: codingerror
            Stack trace:
            line 397 of /lib/setuplib.php: coding_exception thrown
            line 1292 of /lib/outputrenderers.php: call to default_error_handler()
            line 407 of /mod/wiki/renderer.php: call to core_renderer->single_select()
            line 301 of /mod/wiki/pagelib.php: call to mod_wiki_renderer->wiki_print_subwiki_selector()
            line 306 of /mod/wiki/view.php: call to page_wiki_view->print_header()
            

            So patch do solve this issue.

            Show
            Rajesh Taneja added a comment - Works Great, Thanks Charles and everyone. FYI: I tried removing the patch and as a student tried to save page. Got following error: Debug info: Argument 3 passed to core_renderer::single_select() must be an array, null given, called in /var/www/im/mod/wiki/renderer.php on line 407 and defined Error code: codingerror Stack trace: line 397 of /lib/setuplib.php: coding_exception thrown line 1292 of /lib/outputrenderers.php: call to default_error_handler() line 407 of /mod/wiki/renderer.php: call to core_renderer->single_select() line 301 of /mod/wiki/pagelib.php: call to mod_wiki_renderer->wiki_print_subwiki_selector() line 306 of /mod/wiki/view.php: call to page_wiki_view->print_header() So patch do solve this issue.
            Hide
            Dan Poltawski added a comment -

            asko, Дзякуй, ধন্যবাদ, Благодаря, Gràcies, 感谢, 謝謝, Hvala, Díky, Tak, Bedankt, Tänan, متشکریم, Salamat, Kiitokset, Merci, Grazas, Danke, Ευχαριστώ, આભાર, תודה, धन्यवाद, Köszönjük, Takk fyrir, Terima Kasih, Grazie, ありがとうございます, Рахмет, សូមអរគុណ, 감사합니다, gratiās, Pateicamies, Ačiū, Благодарам, Tēnā koa, Kia Ora Rawa Atu, आभारी आहोत, Талархал, Takk, Dziękuję, Obrigado, Mulţumesc, Engraziel, Спасибо, Fa'afetai, Хвала, Hvala, ස්තූතියි, Vďaka, Hvala, Mahadsanid, Thanks, Gracias, Tack, Salamat, நன்றி, నెనరులు, ขอบคุณค่ะ!

            Your work has made it into this weeks Moodle release! There are no gold medals available this week - but millions around the world will benefit. Thank you!

            Show
            Dan Poltawski added a comment - asko, Дзякуй, ধন্যবাদ, Благодаря, Gràcies, 感谢, 謝謝, Hvala, Díky, Tak, Bedankt, Tänan, متشکریم, Salamat, Kiitokset, Merci, Grazas, Danke, Ευχαριστώ, આભાર, תודה, धन्यवाद, Köszönjük, Takk fyrir, Terima Kasih, Grazie, ありがとうございます, Рахмет, សូមអរគុណ, 감사합니다, gratiās, Pateicamies, Ačiū, Благодарам, Tēnā koa, Kia Ora Rawa Atu, आभारी आहोत, Талархал, Takk, Dziękuję, Obrigado, Mulţumesc, Engraziel, Спасибо, Fa'afetai, Хвала, Hvala, ස්තූතියි, Vďaka, Hvala, Mahadsanid, Thanks, Gracias, Tack, Salamat, நன்றி, నెనరులు, ขอบคุณค่ะ! Your work has made it into this weeks Moodle release! There are no gold medals available this week - but millions around the world will benefit. Thank you!
            Hide
            Buddy Ethridge added a comment -

            We never got the fatal error, but we are getting strange results. We have an instructor who created a collaborative wiki in separate group mode (our default). There is one group in the course. When the instructor or an administrator accesses the wiki, everything appears fine. When I switch my role to that of a student, everything still appears fine. However, when I actually login as a student, I cannot access nor edit the wiki. Switching the wiki to No Groups restores access and editing capabilities to the student.

            Not sure if this is a related issue or not. We are currently running 2.2.3 with plans to move to 2.3.1 this weekend.

            Show
            Buddy Ethridge added a comment - We never got the fatal error, but we are getting strange results. We have an instructor who created a collaborative wiki in separate group mode (our default). There is one group in the course. When the instructor or an administrator accesses the wiki, everything appears fine. When I switch my role to that of a student, everything still appears fine. However, when I actually login as a student, I cannot access nor edit the wiki. Switching the wiki to No Groups restores access and editing capabilities to the student. Not sure if this is a related issue or not. We are currently running 2.2.3 with plans to move to 2.3.1 this weekend.

              People

              • Votes:
                4 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: