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

lib/simpletest/testfilelib.php causing fatal errors

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: 2.0
    • Fix Version/s: STABLE backlog
    • Component/s: Files API
    • Labels:
      None
    • Affected Branches:
      MOODLE_20_STABLE

      Description

      lib/simpletest/testfilelib.php does require_once($CFG->dirroot.'/user/lib.php'); which does not exist, causing fatal errors.

      CVS says you introduced it Nico. Please fix.

      I have committed a temporary change commenting out that line.

      (Also many blog unit test failures for me.)

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

              Hide
              timhunt Tim Hunt added a comment -

              Actually commenting that out was insufficient, since one of the tests uses a non-existant create_user function.

              New interim fix: lib/simpletest/testfilelib.php renamed to lib/simpletest/broken_testfilelib.php

              Show
              timhunt Tim Hunt added a comment - Actually commenting that out was insufficient, since one of the tests uses a non-existant create_user function. New interim fix: lib/simpletest/testfilelib.php renamed to lib/simpletest/broken_testfilelib.php
              Hide
              saganxis Gabriel Dias added a comment -

              Hi there, i submitted a patch where i replace the create_user function call for $this->user->id = $DB->insert_record('user', $this->user);
              Then the tests run fine but there is some issue with test test_encodepath when comparing
              http://test.url.com/path/to/page.php%3Fvar1%3Dvalue1%26var2%3Dvalue2%26forcedownload%3D1
              with
              file_encode_url('http://test.url.com', '/path/to/page.php?var1=value1&var2=value2', true)

              The file_encode_url function returns "http://test.url.com/path/to/page.php%3Fvar1%3Dvalue1%26var2%3Dvalue2?forcedownload=1". As you can see the last "?" is wrong. I think there is no check over the quantity of parameters passed with the url when calling this function, if you agree i can create a bug and submit a patch too.

              Show
              saganxis Gabriel Dias added a comment - Hi there, i submitted a patch where i replace the create_user function call for $this->user->id = $DB->insert_record('user', $this->user); Then the tests run fine but there is some issue with test test_encodepath when comparing http://test.url.com/path/to/page.php%3Fvar1%3Dvalue1%26var2%3Dvalue2%26forcedownload%3D1 with file_encode_url('http://test.url.com', '/path/to/page.php?var1=value1&var2=value2', true) The file_encode_url function returns "http://test.url.com/path/to/page.php%3Fvar1%3Dvalue1%26var2%3Dvalue2?forcedownload=1". As you can see the last "?" is wrong. I think there is no check over the quantity of parameters passed with the url when calling this function, if you agree i can create a bug and submit a patch too.
              Hide
              dougiamas Martin Dougiamas added a comment -

              Is this still a problem?

              Show
              dougiamas Martin Dougiamas added a comment - Is this still a problem?
              Hide
              skodak Petr Skoda added a comment -

              unfortunately the 'broken' file tests need a complete rewrite, lowering priority for now

              Show
              skodak Petr Skoda added a comment - unfortunately the 'broken' file tests need a complete rewrite, lowering priority for now
              Hide
              poltawski Dan Poltawski added a comment -

              I think this existed right until we switched to phpunit, closing wont fix.

              Show
              poltawski Dan Poltawski added a comment - I think this existed right until we switched to phpunit, closing wont fix.

                People

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

                  Dates

                  • Created:
                    Updated:
                    Resolved: