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

HTML-Element file throws warning in strict mode

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Deferred
    • Affects Version/s: 2.7.3, 3.6.1
    • Fix Version/s: None
    • Component/s: Forms Library
    • Labels:
    • Testing Instructions:
      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.
    • Affected Branches:
      MOODLE_27_STABLE, MOODLE_36_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-48763-master_file_element_throws_warning

      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

              Assignee:
              jaked Jake Dallimore
              Reporter:
              wagner139 Andreas Wagner
              Peer reviewer:
              Jake Dallimore Jake Dallimore
              Participants:
              Component watchers:
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Sujith Haridasan
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: