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

HTML-Element file throws warning in strict mode

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Deferred
    • Icon: Minor Minor
    • None
    • 2.7.3, 3.6.1
    • Forms Library
    • MOODLE_27_STABLE, MOODLE_36_STABLE
    • MDL-48763-master_file_element_throws_warning
    • Hide
      1. Enable DEVELOPER.. mode for Debugmessages and "Display debug messages" at your testsite
      2. Copy filepicker.php and upload_form.php (temporarily) to the root directory of moodle.
      3. Run filepicker.php
      4. Verify that you don't see the php warnings, when you have integrated the patch.
      Show
      Enable DEVELOPER.. mode for Debugmessages and "Display debug messages" at your testsite Copy filepicker.php and upload_form.php (temporarily) to the root directory of moodle. Run filepicker.php Verify that you don't see the php warnings, when you have integrated the patch.

      When using HTML-Element "file" in a standard moodle form there is a strict standards warning thrown, because the implementation integrated from pear is missing the parameter $values:

      Strict Standards: Declaration of HTML_QuickForm_file::_findValue() should be compatible with HTML_QuickForm_element::_findValue(&$values) in C:\Users\Admin\xampp183\htdocs\ecommunity\lib\pear\HTML\QuickForm\file.php on line 346

      I know, that using the "file" Element is not recommended, but there might be situations (like uploading a file in the filepicker dialogue), where you might not like to use the fliemanager (as for us by developing a new repository plugin).

      I like to suggest to add the parameter of the inherited method _findValue() in /lib/pear/HTML/QuickForm/file.php as follows to match strict standards.

      function _findValue(&$values = array()) {

        1. filepicker.php
          1 kB
          Andreas Wagner
        2. screenshot-1.png
          74 kB
          Andreas Wagner
        3. upload_form.php
          1 kB
          Andreas Wagner

            jaked Jake Dallimore
            wagner139 Andreas Wagner
            Jake Dallimore Jake Dallimore
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.