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

Strict php standards not met by tablelib.php, DEVELOPER debugging mode

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.3.9, 2.4.6, 2.5, 2.5.2, 2.6
    • Fix Version/s: 2.5.5, 2.6.2
    • Component/s: Libraries
    • Labels:
    • Testing Instructions:
      1. Set the debugging mode to DEVELOPER
      2. Download, e.g., a quiz statistics report in ODS format.
      3. Verify the file is valid.
    • Affected Branches:
      MOODLE_23_STABLE, MOODLE_24_STABLE, MOODLE_25_STABLE, MOODLE_26_STABLE
    • Fixed Branches:
      MOODLE_25_STABLE, MOODLE_26_STABLE
    • Pull Master Branch:
      MDL-40410-Strict-Standards

      Description

      1) Set the debugging mode to DEVELOPER
      2) Download, e.g., a quiz statistics report in ODS format.
      3) The file is invalid because PHP strict standards are not met by tablelib.php
      The file looks as follows:
      --------------------------
      Strict Standards: Only variables should be assigned by reference in /home/jzimmer/git/25/lib/tablelib.php on line 1504

      Strict Standards: Only variables should be assigned by reference in /home/jzimmer/git/25/lib/tablelib.php on line 1506
      PK########�h�B�l9�,###.#######mimetype#A # ##
      --------------------------

      I agree, the problem is not critical but very annoying during development...
      and, I suppose, Moodle should meet the strict standards.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

              Hide
              xxxxxxx Gordon Bateson added a comment - - edited

              This problem persists in Moodle 2.6.

              These are the troublesome lines in "lib/tablelib.php"

              $eci =& $this->export_class_instance();                       (line 800)
              $this->formatnormal =& $this->workbook->add_format();         (line 1530)
              $this->formatheaders =& $this->workbook->add_format();        (line 1532)
              

              To reproduce, switch Moodle debugging mode to DEVELOPER, navigate to the "Results" page of a quiz, and download the results in Excel format.

              The easy fix is to remove ampersands in the above lines of code.

              Show
              xxxxxxx Gordon Bateson added a comment - - edited This problem persists in Moodle 2.6. These are the troublesome lines in "lib/tablelib.php" $eci =& $this->export_class_instance(); (line 800) $this->formatnormal =& $this->workbook->add_format(); (line 1530) $this->formatheaders =& $this->workbook->add_format(); (line 1532) To reproduce, switch Moodle debugging mode to DEVELOPER, navigate to the "Results" page of a quiz, and download the results in Excel format. The easy fix is to remove ampersands in the above lines of code.
              Hide
              xxxxxxx Gordon Bateson added a comment -

              I have created a PULL request .. I think ?! .. for removal of ampersand in troublesome lines in lib/tablelib.php on "master" branch

              Show
              xxxxxxx Gordon Bateson added a comment - I have created a PULL request .. I think ?! .. for removal of ampersand in troublesome lines in lib/tablelib.php on "master" branch
              Hide
              cibot CiBoT added a comment -

              Results for MDL-40410

              Show
              cibot CiBoT added a comment - Results for MDL-40410 Remote repository: https://github.com/gbateson/moodle.git Remote branch MDL-40410 -Strict-Standards to be integrated into upstream master Executed job http://integration.moodle.org/job/Precheck%20remote%20branch/869 Error: The MDL-40410 -Strict-Standards branch at https://github.com/gbateson/moodle.git and master does not have any common ancestor.
              Hide
              xxxxxxx Gordon Bateson added a comment - - edited

              Sorry, looks like I messed up the PULL request.

              I have tried to create another one here:

              The above fork contains that following tablelib.php file

              Show
              xxxxxxx Gordon Bateson added a comment - - edited Sorry, looks like I messed up the PULL request. I have tried to create another one here: github MDL-40410-Strict-Standards The above fork contains that following tablelib.php file tabellib.php
              Hide
              cibot CiBoT added a comment -

              Moving this issue to current integration cycle, will be reviewed soon. Thanks for the hard work!

              Show
              cibot CiBoT added a comment - Moving this issue to current integration cycle, will be reviewed soon. Thanks for the hard work!
              Hide
              samhemelryk Sam Hemelryk added a comment -

              Thanks Gordon - this has been integrated now.

              Show
              samhemelryk Sam Hemelryk added a comment - Thanks Gordon - this has been integrated now.
              Hide
              dmonllao David Monllaó added a comment -

              It passes. Tested in 25, 26 and master.

              Show
              dmonllao David Monllaó added a comment - It passes. Tested in 25, 26 and master.
              Hide
              dmonllao David Monllaó added a comment -

              Linking discovered issue while testing (only master)

              Show
              dmonllao David Monllaó added a comment - Linking discovered issue while testing (only master)
              Hide
              samhemelryk Sam Hemelryk added a comment -

              This weeks weekly release is now available and includes your code.
              A big pat on the back to you again for once more being a cog in the Moodle machine.

              Best wishes, the Moodle integration team.

              Show
              samhemelryk Sam Hemelryk added a comment - This weeks weekly release is now available and includes your code. A big pat on the back to you again for once more being a cog in the Moodle machine. Best wishes, the Moodle integration team.
              Hide
              mudrd8mz David Mudrák added a comment -

              Gordon Bateson looking at https://moodle.org/dev/gitcommits.php?version=2.6.2&lastname=Bateson&firstname=Gordon&email=gorodnbateson@gmail.com&merges=0 it looks like you had a typo in your Git configuration, leading to invalid e-mails (see the email). You may wish to review your setup. Meanwhile, I'll just add "gorodnbateson@gmail.com" as an alias of your real email.

              Show
              mudrd8mz David Mudrák added a comment - Gordon Bateson looking at https://moodle.org/dev/gitcommits.php?version=2.6.2&lastname=Bateson&firstname=Gordon&email=gorodnbateson@gmail.com&merges=0 it looks like you had a typo in your Git configuration, leading to invalid e-mails (see the email). You may wish to review your setup. Meanwhile, I'll just add "gorodnbateson@gmail.com" as an alias of your real email.
              Hide
              xxxxxxx Gordon Bateson added a comment -

              Hi David, wow - well spotted! You were quite right, the email address on the git config of my local machine was set wrongly. It have fixed it now. Thanks for finding this and adding the email alias. regards, Gordon

              Show
              xxxxxxx Gordon Bateson added a comment - Hi David, wow - well spotted! You were quite right, the email address on the git config of my local machine was set wrongly. It have fixed it now. Thanks for finding this and adding the email alias. regards, Gordon

                People

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

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    10/Mar/14