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

Export to portolio: invalid database query parameter

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Not a bug
    • Affects Version/s: 2.6.6, 2.7.3
    • Fix Version/s: None
    • Component/s: Portfolio
    • Labels:
      None
    • Affected Branches:
      MOODLE_26_STABLE, MOODLE_27_STABLE

      Description

      While exporting to Mahara portfolio (was discovered in ouwiki module), the following error appears:

      Failed to start communication with remote server: remote server error: code: , message: Failed to retrieve zipfile from remote server: Unknown error occurred: 0: Coding error detected, it must be fixed by a programmer: Invalid database query parameter valueERROR 4: 4: remote server error: code: , message: Failed to retrieve zipfile from remote server: Unknown error occurred: 0: Coding error detected, it must be fixed by a programmer: Invalid database query parameter value

      I traced it to the log_transfer() method in portfolio_exporter class. Apparently, instead of string an instance of moodle_url gets transferred into $DB->insert_record(), which crashes the functionality. The following helps:

      --- a/lib/portfolio/exporter.php
      +++ b/lib/portfolio/exporter.php
      @@ -536,7 +536,7 @@ class portfolio_exporter {
                   'caller_sha1' => $this->caller->get_sha1(),
                   'caller_class' => get_class($this->caller),
                   'continueurl' => $this->instance->get_static_continue_url(),
      -            'returnurl' => $this->caller->get_return_url(),
      +            'returnurl' => (string) $this->caller->get_return_url(),
                   'tempdataid' => $this->id,
                   'time' => time(),
               );
      

        Attachments

          Activity

            People

            • Assignee:
              poltawski Dan Poltawski
              Reporter:
              sergeyandro Sergey Vidusov
              Participants:
              Component watchers:
              Amaia Anabitarte, Carlos Escobedo, Sara Arjona (@sarjona), Víctor Déniz Falcón
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: