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

Invalid JSON output on filepicker when repository plugins output invalid content

    Details

    • Testing Instructions:
      Hide

      With debugging disabled:

      • Open the profile editing page
      • Open the file picker for account images
      • Select each of the repositories, search for and select an image using each one
        • Confirm no errors were shown at any stage
      • Expand the site administration menu (2.6 and master only
        • Confirm no errors were displayed*
      • Edit repositories/wikimedia/wikimedia.php and theme/splash/settings.php
        • Add a character before the opening php tags
      • Repeat the tests confirming a complete lack of errors
      • Expand the site administration menu (2.6 and master only
        • Confirm no errors were displayed*

      Set debug to debug_developer

      • repeat the tests
        • Confirm: An ajaxException should be shown for plugins which have any invalid output associated with them
      Show
      With debugging disabled: Open the profile editing page Open the file picker for account images Select each of the repositories, search for and select an image using each one Confirm no errors were shown at any stage Expand the site administration menu (2.6 and master only Confirm no errors were displayed* Edit repositories/wikimedia/wikimedia.php and theme/splash/settings.php Add a character before the opening php tags Repeat the tests confirming a complete lack of errors Expand the site administration menu (2.6 and master only Confirm no errors were displayed* Set debug to debug_developer repeat the tests Confirm: An ajaxException should be shown for plugins which have any invalid output associated with them
    • Affected Branches:
      MOODLE_23_STABLE
    • Fixed Branches:
      MOODLE_24_STABLE, MOODLE_25_STABLE, MOODLE_26_STABLE
    • Pull Master Branch:
      MDL-34182-master
    • Story Points (Obsolete):
      8
    • Sprint:
      FRONTEND Sprint 7

      Description

      I have just installed MOODLE V2.3 and have tried to upload and restore my backup files from MOODLE V1.9.18. When I select a Small backup file it run ok from the file picker but when I select a larger one say 25Megs using the File Picker then an Error Dialogue Box comes up informing me of the Invalid JSON Script.

      I turned on the Debugger and found the following script message;
      ----------------------------------------------------------------------------------------
      Invalid JSON string

      Fatal error: Allowed memory size of 100663296 bytes exhausted (tried to allocate 85462399 bytes) in /home/souther9/public_html/lib/filelib.php on line 3066
      ----------------------------------------------------------------------------------------

      When I checked the code it displays the following so I am not sure where to go to next;
      _________________________________________________________________________________________________________________
      // create curl instance
      $curl = curl_init($url);
      $options['url'] = $url;
      $this->apply_opt($curl, $options);
      if ($this->cache && $ret = $this->cache->get($this->options))

      { return $ret; } else {
      $ret = curl_exec($curl);
      if ($this->cache) { $this->cache->set($this->options, $ret); }
      }

      $this->info = curl_getinfo($curl);
      $this->error = curl_error($curl);

      if ($this->debug){ echo '<h1>Return Data</h1>'; var_dump($ret); echo '<h1>Info</h1>'; var_dump($this->info); echo '<h1>Error</h1>'; var_dump($this->error); }

      curl_close($curl);

      if (empty($this->error)){ return $ret; }

      else

      { return $this->error; // exception is not ajax friendly //throw new moodle_exception($this->error, 'curl'); }

      }
      ___________________________________________________________________________________

      Can anyone help me get this sorted out please I have tried the forums and looked through some of the other issues but to no help found.

      Thanks

      Jim Kersting

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

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

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    13/Jan/14