Details

    • Type: Sub-task Sub-task
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.5
    • Fix Version/s: 2.5
    • Component/s: SCORM
    • Labels:
    • Rank:
      48766

      Description

      Since MDL-34311 this triggers debug messages in the page.

      Did you remember to call setType() for 'scormtype'? Defaulting to PARAM_RAW cleaning.
      line 1266 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 71 of /course/moodleform_mod.php: call to moodleform->moodleform()
      line 248 of /course/modedit.php: call to moodleform_mod->moodleform_mod()
      Did you remember to call setType() for 'MAX_FILE_SIZE'? Defaulting to PARAM_RAW cleaning.
      line 1266 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 71 of /course/moodleform_mod.php: call to moodleform->moodleform()
      line 248 of /course/modedit.php: call to moodleform_mod->moodleform_mod()
      Did you remember to call setType() for 'updatefreq'? Defaulting to PARAM_RAW cleaning.
      line 1266 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 71 of /course/moodleform_mod.php: call to moodleform->moodleform()
      line 248 of /course/modedit.php: call to moodleform_mod->moodleform_mod()
      

        Activity

        Hide
        Dan Poltawski added a comment - - edited

        Hmm, looking into the max filesize one, but the others:

        diff --git a/mod/scorm/mod_form.php b/mod/scorm/mod_form.php
        index 03add22..a3034e2 100644
        --- a/mod/scorm/mod_form.php
        +++ b/mod/scorm/mod_form.php
        @@ -76,6 +76,7 @@ class mod_scorm_mod_form extends moodleform_mod {
                     $mform->disabledIf('packageurl', 'scormtype', 'eq', SCORM_TYPE_LOCAL);
                 } else {
                     $mform->addElement('hidden', 'scormtype', SCORM_TYPE_LOCAL);
        +            $mform->setType('scormtype', PARAM_ALPHA);
                 }
        
                 // New local package upload
        @@ -249,6 +250,7 @@ class mod_scorm_mod_form extends moodleform_mod {
                     $mform->disabledIf('updatefreq', 'scormtype', 'eq', SCORM_TYPE_LOCAL);
                 } else {
                     $mform->addElement('hidden', 'updatefreq', 0);
        +            $mform->setType('updatefreq', PARAM_INT);
                 }
                 //-------------------------------------------------------------------------------
                 // Hidden Settings
        
        Show
        Dan Poltawski added a comment - - edited Hmm, looking into the max filesize one, but the others: diff --git a/mod/scorm/mod_form.php b/mod/scorm/mod_form.php index 03add22..a3034e2 100644 --- a/mod/scorm/mod_form.php +++ b/mod/scorm/mod_form.php @@ -76,6 +76,7 @@ class mod_scorm_mod_form extends moodleform_mod { $mform->disabledIf('packageurl', 'scormtype', 'eq', SCORM_TYPE_LOCAL); } else { $mform->addElement('hidden', 'scormtype', SCORM_TYPE_LOCAL); + $mform->setType('scormtype', PARAM_ALPHA); } // New local package upload @@ -249,6 +250,7 @@ class mod_scorm_mod_form extends moodleform_mod { $mform->disabledIf('updatefreq', 'scormtype', 'eq', SCORM_TYPE_LOCAL); } else { $mform->addElement('hidden', 'updatefreq', 0); + $mform->setType('updatefreq', PARAM_INT); } //------------------------------------------------------------------------------- // Hidden Settings
        Hide
        Dan Poltawski added a comment - - edited

        Damyon and I were looking at this and we think that the setMaxFileSize call is actually doing nothing in the new file picker because the actual upload is done in a different form. It appears that the purpose of the function is to set MAX_FILE_SIZE as specified in here: http://php.net/manual/en/features.file-upload.post-method.php

        Another alternative is:

        --- a/lib/formslib.php
        +++ b/lib/formslib.php
        @@ -1295,7 +1295,7 @@ abstract class moodleform {
          */
         class MoodleQuickForm extends HTML_QuickForm_DHTMLRulesTableless {
             /** @var array type (PARAM_INT, PARAM_TEXT etc) of element value */
        -    var $_types = array();
        +    var $_types = array('MAX_FILE_SIZE' => PARAM_INT);
        
             /** @var array dependent state for the element/'s */
             var $_dependencies = array();
        
        Show
        Dan Poltawski added a comment - - edited Damyon and I were looking at this and we think that the setMaxFileSize call is actually doing nothing in the new file picker because the actual upload is done in a different form. It appears that the purpose of the function is to set MAX_FILE_SIZE as specified in here: http://php.net/manual/en/features.file-upload.post-method.php Another alternative is: --- a/lib/formslib.php +++ b/lib/formslib.php @@ -1295,7 +1295,7 @@ abstract class moodleform { */ class MoodleQuickForm extends HTML_QuickForm_DHTMLRulesTableless { /** @ var array type (PARAM_INT, PARAM_TEXT etc) of element value */ - var $_types = array(); + var $_types = array('MAX_FILE_SIZE' => PARAM_INT); /** @ var array dependent state for the element/'s */ var $_dependencies = array();
        Hide
        Dan Marsden added a comment -

        thanks Dan/Damyon - that maxfilesize thing can be removed as it's no longer needed - it was added in MDL-16722

        Show
        Dan Marsden added a comment - thanks Dan/Damyon - that maxfilesize thing can be removed as it's no longer needed - it was added in MDL-16722
        Hide
        Damyon Wiese added a comment -

        The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week.

        Thanks!

        Show
        Damyon Wiese added a comment - The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week. Thanks!
        Hide
        Dan Poltawski added a comment -

        Integrated, thanks Dan.

        Show
        Dan Poltawski added a comment - Integrated, thanks Dan.
        Hide
        Rossiani Wijaya added a comment -

        This is working as expected.

        Tested for master only.

        Test passed.

        Show
        Rossiani Wijaya added a comment - This is working as expected. Tested for master only. Test passed.
        Hide
        Dan Poltawski added a comment -

        Did you remember to call thankDevelopers() for 'this_weeks_work'? Defaulting to PARAM_SHODDY thanking.

        line 1289 of \lib\changes.php: call to debugging()
        line 281 of \lib\are.php: call to moodleform->detectMissingThanks()
        line 202 of \lib\now.php: call to moodleform->_is_poor_form()
        line 73 of \course\upstream.php: call to moodleform->forgetingToThank()

        Show
        Dan Poltawski added a comment - Did you remember to call thankDevelopers() for 'this_weeks_work'? Defaulting to PARAM_SHODDY thanking. line 1289 of \lib\changes.php: call to debugging() line 281 of \lib\are.php: call to moodleform->detectMissingThanks() line 202 of \lib\now.php: call to moodleform->_is_poor_form() line 73 of \course\upstream.php: call to moodleform->forgetingToThank()

          People

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

            Dates

            • Created:
              Updated:
              Resolved: