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

HTML-Element file throws warning in strict mode

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Deferred
    • 2.7.3, 3.6.1
    • None
    • 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.

    Description

      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()) {

      Attachments

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

        Issue Links

          Activity

            People

              jaked Jake Dallimore
              wagner139 Andreas Wagner
              Jake Dallimore Jake Dallimore
              David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: