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

Accessing non-static methods in repository class as static (PHP meta STRICT)

    Details

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

      1. enable strict mode in php.ini
      2. force strict mode in main config.php

      3. Using FilePicker try to add the file with the same name as already existing. The popup dialog should appear with choice s: Rename, Overwrite, Cancel.
      Make sure all buttons work as expected.

      Show
      1. enable strict mode in php.ini 2. force strict mode in main config.php 3. Using FilePicker try to add the file with the same name as already existing. The popup dialog should appear with choice s: Rename, Overwrite, Cancel. Make sure all buttons work as expected.
    • Affected Branches:
      MOODLE_22_STABLE
    • Fixed Branches:
      MOODLE_23_STABLE
    • Pull Master Branch:
      wip-MDL-32381-master
    • Rank:
      39237

      Description

      I found number of PHP notices when using STRICT:

      Strict Standards: Non-static method repository::overwrite_existing_draftfile() should not be called statically in /var/www/repositories/master/moodle/repository/repository_ajax.php on line 278
      true

      the same for function append_suffix($filename) and delete_tempfile_from_draft($draftitemid, $filepath, $filename)

        Issue Links

          Activity

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

          Hi Marina,

          Thanks - that has been integrated now. Only on master though as we are not backporting strict fixes to the stable branches.

          Show
          Dan Poltawski added a comment - Hi Marina, Thanks - that has been integrated now. Only on master though as we are not backporting strict fixes to the stable branches.
          Hide
          Andrew Davis added a comment - - edited

          Looks ok. One question though. It works as described if I click the "Add..." button then choose the upload repository. If I just drag the file into the upload area additional copies of the file automatically get created ie you wind up with file.jpg and file_2.jpg. Its automatically performing the same action as if you had selected "Rename". Is this a problem?

          Show
          Andrew Davis added a comment - - edited Looks ok. One question though. It works as described if I click the "Add..." button then choose the upload repository. If I just drag the file into the upload area additional copies of the file automatically get created ie you wind up with file.jpg and file_2.jpg. Its automatically performing the same action as if you had selected "Rename". Is this a problem?
          Hide
          Marina Glancy added a comment -

          I suppose yes. You may ask Davo Smith (see MDL-31114 and its predecessors)

          Show
          Marina Glancy added a comment - I suppose yes. You may ask Davo Smith (see MDL-31114 and its predecessors)
          Hide
          Andrew Davis added a comment -

          So should I fall this issue or open a new bug?

          Show
          Andrew Davis added a comment - So should I fall this issue or open a new bug?
          Hide
          Marina Glancy added a comment -

          Sorry Andrew, when I said "yes" I meant that this is ok.
          I don't think this is a problem. And this is definitely completely unrelated to this bug.
          You can create a new bug for Davo and he'll decide whether to fix it or close.

          Show
          Marina Glancy added a comment - Sorry Andrew, when I said "yes" I meant that this is ok. I don't think this is a problem. And this is definitely completely unrelated to this bug. You can create a new bug for Davo and he'll decide whether to fix it or close.
          Hide
          Andrew Davis added a comment -

          Passing this issue. I have raised MDL-32513

          Show
          Andrew Davis added a comment - Passing this issue. I have raised MDL-32513
          Hide
          Dan Poltawski added a comment -

          Bonza mate!

          Your changes have made it into the Moodle release! Its time to celebrate! Put a shrimp on the barbie and grab a stubby.

          Hooroo

          Show
          Dan Poltawski added a comment - Bonza mate! Your changes have made it into the Moodle release! Its time to celebrate! Put a shrimp on the barbie and grab a stubby. Hooroo

            People

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

              Dates

              • Created:
                Updated:
                Resolved: