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

Choice not working in 1.9 when using Limits

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.9
    • Fix Version/s: 1.9.1
    • Component/s: Choice
    • Labels:
      None
    • Environment:
      lighttpd, php-cgi (fastcgi), mysql (all debian)
    • Database:
      MySQL
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE

      Description

      The form displaying the choice options is not being shown anymore when creating a new choice activity. This is independend from the role. In HTML-Code the whole form exept for the submission button is missing. Code from 1.9beta4 runs fine.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

              Hide
              danmarsden Dan Marsden added a comment -

              Hi There,

              the choice changed quite a bit just before the 1.9 release - can you please make sure you have updated copies of all the files in the choice folder?

              thanks!

              Dan

              Show
              danmarsden Dan Marsden added a comment - Hi There, the choice changed quite a bit just before the 1.9 release - can you please make sure you have updated copies of all the files in the choice folder? thanks! Dan
              Hide
              jknegten Jörg Knegten added a comment -

              Hi Dan,

              I can approve this, idependently from Maik.

              It worked in 1.9 Beta 4 but no longer in 1.9 final.

              I just downlaoded the 1.9 final files completely from cvs and replaced the whole choice module.

              Result: no boxes to make your choice

              I replaced the choice module with the files from 1.9 Beta 4 and the boxes did appear immediately.

              Jörg

              Show
              jknegten Jörg Knegten added a comment - Hi Dan, I can approve this, idependently from Maik. It worked in 1.9 Beta 4 but no longer in 1.9 final. I just downlaoded the 1.9 final files completely from cvs and replaced the whole choice module. Result: no boxes to make your choice I replaced the choice module with the files from 1.9 Beta 4 and the boxes did appear immediately. Jörg
              Hide
              mccab99 Maik Riecken added a comment -

              Previous copy of moodle has been deleted before fresh install. There should be no artefacts of old files.

              Maik

              Show
              mccab99 Maik Riecken added a comment - Previous copy of moodle has been deleted before fresh install. There should be no artefacts of old files. Maik
              Hide
              danmarsden Dan Marsden added a comment -

              are you sure that your users have the role: "mod/choice:choose" set to allow?

              thanks,

              Dan

              Show
              danmarsden Dan Marsden added a comment - are you sure that your users have the role: "mod/choice:choose" set to allow? thanks, Dan
              Hide
              danmarsden Dan Marsden added a comment -

              there were also a few changes made to the Get_users_by_capability function in lib - make sure your lib files are all up-to-date as well....

              Show
              danmarsden Dan Marsden added a comment - there were also a few changes made to the Get_users_by_capability function in lib - make sure your lib files are all up-to-date as well....
              Hide
              danmarsden Dan Marsden added a comment -

              ok - I'm having trouble replicating this - screenshots please? - and also details about the settings you have made in your choice? groups? limits? etc etc?

              thanks!

              Dan

              Show
              danmarsden Dan Marsden added a comment - ok - I'm having trouble replicating this - screenshots please? - and also details about the settings you have made in your choice? groups? limits? etc etc? thanks! Dan
              Hide
              danmarsden Dan Marsden added a comment -

              think I've found it - 1min to patch.

              Show
              danmarsden Dan Marsden added a comment - think I've found it - 1min to patch.
              Hide
              danmarsden Dan Marsden added a comment -

              fix now in 1.9Stable and Head.

              find this in mod\choice\lib.php in function choice_show_form()

              • if (isset($text) && isset($allresponses[$optionid])) { //make sure there are no dud entries in the db with blank text values.

              replace with this:
              + if (isset($text)) { //make sure there are no dud entries in the db with blank text values.

              Show
              danmarsden Dan Marsden added a comment - fix now in 1.9Stable and Head. find this in mod\choice\lib.php in function choice_show_form() if (isset($text) && isset($allresponses [$optionid] )) { //make sure there are no dud entries in the db with blank text values. replace with this: + if (isset($text)) { //make sure there are no dud entries in the db with blank text values.
              Hide
              danmarsden Dan Marsden added a comment -

              flagging this as fixed - please let me know if is/ is not fixed in your environments, so we can close this. - Thanks for the report!

              Dan

              Show
              danmarsden Dan Marsden added a comment - flagging this as fixed - please let me know if is/ is not fixed in your environments, so we can close this. - Thanks for the report! Dan
              Hide
              jknegten Jörg Knegten added a comment -

              Hello Dan,

              I loaded the files from cvs quite now.

              It seems you did it. It's workling like it should.

              Hope so, Maik gets the similar results.

              Thanks.
              Jörg

              Show
              jknegten Jörg Knegten added a comment - Hello Dan, I loaded the files from cvs quite now. It seems you did it. It's workling like it should. Hope so, Maik gets the similar results. Thanks. Jörg
              Hide
              mccab99 Maik Riecken added a comment - - edited

              Fixed. Thanks a lot. In debug mode unknown objects warnings showing up (path shortened):

              Notice: Undefined offset: 5 in /mod/choice/lib.php on line 147

              Notice: Undefined offset: 6 in /mod/choice/lib.php on line 147

              Notice: Undefined offset: 7 in /mod/choice/lib.php on line 147

              Show
              mccab99 Maik Riecken added a comment - - edited Fixed. Thanks a lot. In debug mode unknown objects warnings showing up (path shortened): Notice: Undefined offset: 5 in /mod/choice/lib.php on line 147 Notice: Undefined offset: 6 in /mod/choice/lib.php on line 147 Notice: Undefined offset: 7 in /mod/choice/lib.php on line 147
              Hide
              danmarsden Dan Marsden added a comment -

              thanks,

              replace that line with this:
              if (isset($allresponses[$optionid]))

              { $cdisplay[$aid]->countanswers = count($allresponses[$optionid]); }

              else

              { $cdisplay[$aid]->countanswers = 0; }

              and it should remove the error - (I'll commit it sometime tomorrow.)

              Show
              danmarsden Dan Marsden added a comment - thanks, replace that line with this: if (isset($allresponses [$optionid] )) { $cdisplay[$aid]->countanswers = count($allresponses[$optionid]); } else { $cdisplay[$aid]->countanswers = 0; } and it should remove the error - (I'll commit it sometime tomorrow.)
              Hide
              danmarsden Dan Marsden added a comment -

              hmmm - my guess is that Demo.moodle.org hasn't been updated since the patch went in - will need to wait for it to be updated with the latest code from 1.9stable.

              thanks,

              Dan

              Show
              danmarsden Dan Marsden added a comment - hmmm - my guess is that Demo.moodle.org hasn't been updated since the patch went in - will need to wait for it to be updated with the latest code from 1.9stable. thanks, Dan
              Hide
              tsala Helen Foster added a comment -

              Tested with latest 1.9+.

              Dan, thanks for fixing

              Show
              tsala Helen Foster added a comment - Tested with latest 1.9+. Dan, thanks for fixing

                People

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

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    15/May/08