Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-31167 PHP strict META
  3. MDL-32454

MNet Peers moodleform validators fail strict standards

    Details

    • Type: Sub-task
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.1.5, 2.2.2, 2.3
    • Fix Version/s: 2.1.6, 2.2.3
    • Component/s: MNet
    • Labels:
    • Testing Instructions:
      Hide

      These changes shouldn't have any effect on functionality:

      • The new validation parameter shouldn't have any effect
      • It's not possible to assign a function result by reference anyway so this should just get rid of the warning
      • The missing $CFG settings shouldn't have any noticable effect as defaults are provided

      One way to test this (I confirmed some of the warnings that way) is to:

      1) Enable DEBUG_DEVELOPER
      2) Enable MNET in the site and visit all the mnet admin pages (admin -> networking) and the tabs and links within them.
      3) TEST: Confirm no PHP NOTICE/WARN/STRICT message is shown.

      Show
      These changes shouldn't have any effect on functionality: The new validation parameter shouldn't have any effect It's not possible to assign a function result by reference anyway so this should just get rid of the warning The missing $CFG settings shouldn't have any noticable effect as defaults are provided One way to test this (I confirmed some of the warnings that way) is to: 1) Enable DEBUG_DEVELOPER 2) Enable MNET in the site and visit all the mnet admin pages (admin -> networking) and the tabs and links within them. 3) TEST: Confirm no PHP NOTICE/WARN/STRICT message is shown.
    • Affected Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE, MOODLE_23_STABLE
    • Fixed Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-32454-master-1

      Description

      With the new strict standards on, navigating to the mnet peers page gives:

      Strict standards: Declaration of mnet_simple_host_form::validation() should be compatible with that of moodleform::validation() in /home/nicols/git/software/moodle/admin/mnet/peer_forms.php on line 35 Call Stack: 0.0005 797360 1. {main}() /home/nicols/git/software/moodle/admin/mnet/peers.php:0 0.1328 35104576 2. require_once('/home/nicols/git/software/moodle/admin/mnet/peer_forms.php') /home/nicols/git/software/moodle/admin/mnet/peers.php:33 Strict standards: Declaration of mnet_review_host_form::validation() should be compatible with that of moodleform::validation() in /home/nicols/git/software/moodle/admin/mnet/peer_forms.php on line 73 Call Stack: 0.0005 797360 1. {main}() /home/nicols/git/software/moodle/admin/mnet/peers.php:0 0.1328 35104576 2. require_once('/home/nicols/git/software/moodle/admin/mnet/peer_forms.php') /home/nicols/git/software/moodle/admin/mnet/peers.php:33

        Gliffy Diagrams

          Activity

          Hide
          dobedobedoh Andrew Nicols added a comment -

          Found some more:

          admin/mnet/services_form.php: only a variable can be assigned by reference
          admin/mnet/profilefields_form.php: undefined variables

          Show
          dobedobedoh Andrew Nicols added a comment - Found some more: admin/mnet/services_form.php: only a variable can be assigned by reference admin/mnet/profilefields_form.php: undefined variables
          Hide
          poltawski Dan Poltawski added a comment -

          +1

          Show
          poltawski Dan Poltawski added a comment - +1
          Hide
          dobedobedoh Andrew Nicols added a comment -

          Note to integrators: This will cherry-pick cleanly to all stable branches.

          Show
          dobedobedoh Andrew Nicols added a comment - Note to integrators: This will cherry-pick cleanly to all stable branches.
          Hide
          poltawski Dan Poltawski 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.

          TIA and ciao

          Show
          poltawski Dan Poltawski 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. TIA and ciao
          Hide
          stronk7 Eloy Lafuente (stronk7) added a comment -

          Uhm, not really sure if backport was necessary for this, as far as only 2.3 is supposed to be E_STRICT compliant... but I realized it after pushing... so... integrated (21, 22 & master). Thanks!

          Show
          stronk7 Eloy Lafuente (stronk7) added a comment - Uhm, not really sure if backport was necessary for this, as far as only 2.3 is supposed to be E_STRICT compliant... but I realized it after pushing... so... integrated (21, 22 & master). Thanks!
          Hide
          andyjdavis Andrew Davis added a comment -

          Works as described. Passing.

          Show
          andyjdavis Andrew Davis added a comment - Works as described. Passing.
          Hide
          stronk7 Eloy Lafuente (stronk7) added a comment -

          This has been near becoming rejected, because it's not the best code you are able to produce.

          But, luckily, at the end, it has landed and has been spread to all repos out there.

          Many thanks and, don't forget it, keep improving your skills, you can!

          Closing, ciao

          Show
          stronk7 Eloy Lafuente (stronk7) added a comment - This has been near becoming rejected, because it's not the best code you are able to produce. But, luckily, at the end, it has landed and has been spread to all repos out there. Many thanks and, don't forget it, keep improving your skills, you can! Closing, ciao

            People

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

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                14/May/12