Details

    • Type: Sub-task Sub-task
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.5
    • Fix Version/s: 2.5.2
    • Component/s: Gradebook
    • Labels:
    • Testing Instructions:
      Hide

      Prerequisite

      1. course with few activities and users having gardes

      Test

      1. Log in as admin
      2. Enable gradepublishing
      3. Go to course and click on Grades
      4. Click on Key manager (Grade administration > Export> Key manager).
      5. Make sure no setType warning appears
      6. Add new key and make sure it gets added without any problem.
      7. Export grades as "Plain text file" (Grade administration > Export> Plain text file)
      8. Make sure no setType warning appears and you can export grades without any problem.
      Show
      Prerequisite course with few activities and users having gardes Test Log in as admin Enable gradepublishing Go to course and click on Grades Click on Key manager (Grade administration > Export > Key manager). Make sure no setType warning appears Add new key and make sure it gets added without any problem. Export grades as "Plain text file" (Grade administration > Export > Plain text file) Make sure no setType warning appears and you can export grades without any problem.
    • Affected Branches:
      MOODLE_25_STABLE
    • Fixed Branches:
      MOODLE_25_STABLE
    • Pull 2.5 Branch:
      wip-mdl-40469-m25
    • Pull Master Branch:
      wip-mdl-40469
    • Rank:
      51271

      Description

      With gradepublishing set, try export gradebook as plain text and you will see following warning:

      Did you remember to call setType() for 'iprestriction'? Defaulting to PARAM_RAW cleaning.
      
          line 1303 of /lib/formslib.php: call to debugging()
          line 281 of /lib/formslib.php: call to moodleform->detectMissingSetType()
          line 202 of /lib/formslib.php: call to moodleform->_process_submission()
          line 43 of /grade/export/txt/index.php: call to moodleform->moodleform()
      

      While generating user key (Grades ► User keys ► Create user key), you will see following warning:

      Did you remember to call setType() for 'iprestriction'? Defaulting to PARAM_RAW cleaning.
      
          line 1303 of /lib/formslib.php: call to debugging()
          line 281 of /lib/formslib.php: call to moodleform->detectMissingSetType()
          line 202 of /lib/formslib.php: call to moodleform->_process_submission()
          line 92 of /grade/export/key.php: call to moodleform->moodleform()
      

        Issue Links

          Activity

          Hide
          Rajesh Taneja added a comment -

          Robert reported this problem in MDL-38851

          Show
          Rajesh Taneja added a comment - Robert reported this problem in MDL-38851
          Hide
          Robert Russo added a comment -

          Thanks Rajesh

          Show
          Robert Russo added a comment - Thanks Rajesh
          Hide
          Ankit Agarwal added a comment - - edited

          Hi Raj,
          Two minor things, you might want to reconsider:-

          1. iprestriction - am not sure what all is allowed here but PARAM_NOTAGS seems more appropriate.
          2. 'key' is of type varchar, PARAM_INT seems incorrect. (Also it is not required to settype for selects)

          Rest looks good.
          Thanks

          Show
          Ankit Agarwal added a comment - - edited Hi Raj, Two minor things, you might want to reconsider:- iprestriction - am not sure what all is allowed here but PARAM_NOTAGS seems more appropriate. 'key' is of type varchar, PARAM_INT seems incorrect. (Also it is not required to settype for selects) Rest looks good. Thanks
          Hide
          Rajesh Taneja added a comment -

          Thanks for the feedback Ankit,

          1. iprestriction is using PARAM_RAW_TRIMMED in admin/webservice/forms.php, so seems fine to me.
          2. Fixed.

          Pushing it for integration.

          Show
          Rajesh Taneja added a comment - Thanks for the feedback Ankit, iprestriction is using PARAM_RAW_TRIMMED in admin/webservice/forms.php, so seems fine to me. Fixed. Pushing it for integration.
          Hide
          Sam Hemelryk added a comment -

          Thanks Raj this has been integrated now

          Show
          Sam Hemelryk added a comment - Thanks Raj this has been integrated now
          Hide
          Rossiani Wijaya added a comment -

          Hi Raj,

          This is working as instructed.

          Tested for 2.5 and master.

          However just some comment regarding the param type for iprestriction, it doesn't seem correct to use PARAM_RAW_TRIMMED. I input characters for key IP restriction and it takes the value as a validate input. (screenshot).

          I am aware that we don't have something like PARAM_IP to use, but it might be good to implement it.

          Other than that, this is working as expected.

          Test passed.

          Show
          Rossiani Wijaya added a comment - Hi Raj, This is working as instructed. Tested for 2.5 and master. However just some comment regarding the param type for iprestriction, it doesn't seem correct to use PARAM_RAW_TRIMMED. I input characters for key IP restriction and it takes the value as a validate input. (screenshot). I am aware that we don't have something like PARAM_IP to use, but it might be good to implement it. Other than that, this is working as expected. Test passed.
          Hide
          Rajesh Taneja added a comment -

          Thanks Rossie,

          This being a admin page, I won't be of much concern. As you have mentioned, there is no existing PARAM_IP to do this, hence keeping it in sync with other use-case.

          Show
          Rajesh Taneja added a comment - Thanks Rossie, This being a admin page, I won't be of much concern. As you have mentioned, there is no existing PARAM_IP to do this, hence keeping it in sync with other use-case.
          Hide
          Sam Hemelryk added a comment -

          Huzzah, your code made it into Moodle. Perhaps now things are ever so slightly better!

          "The ship can't take this much pressure. Sometimes it falls apart just sitting in the hangar."
          ~ Professor Farnsworth

          Show
          Sam Hemelryk added a comment - Huzzah, your code made it into Moodle. Perhaps now things are ever so slightly better! "The ship can't take this much pressure. Sometimes it falls apart just sitting in the hangar." ~ Professor Farnsworth

            People

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

              Dates

              • Created:
                Updated:
                Resolved: