Moodle
  1. Moodle
  2. MDL-31167 PHP strict META
  3. MDL-32454

MNet Peers moodleform validators fail strict standards

    Details

    • Type: Sub-task Sub-task
    • Status: Closed
    • Priority: Minor 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
    • Rank:
      39337

      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
      

        Activity

        Hide
        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
        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
        Dan Poltawski added a comment -

        +1

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

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

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

        Works as described. Passing.

        Show
        Andrew Davis added a comment - Works as described. Passing.
        Hide
        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
        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: