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

Invalid JSON string in webdav repository when path is '/'

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.1.8, 2.2.5
    • Fix Version/s: 2.2.6
    • Component/s: Repositories
    • Labels:
    • Testing Instructions:
      Hide
      1. Set up a WebDAV repository which as '/' as path
      2. Set up another WebDAV repository which as a different path than just '/', '/webdav' for instance.
      3. Make sure you can browse both repositories and download files
      Show
      Set up a WebDAV repository which as '/' as path Set up another WebDAV repository which as a different path than just '/', '/webdav' for instance. Make sure you can browse both repositories and download files
    • Affected Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE
    • Fixed Branches:
      MOODLE_22_STABLE
    • Pull from Repository:

      Description

      We've had this issue reported to us by a client and since I don't have a webdav repository set up I haven't been able to confirm or test the issue. However I think I've isolated the problem and my proposed patch seemed to fix it for them so here it is!

      When viewing the webdav repository in the filepicker they get the error:

      ERROR: Invalid JSON string 
      Warning: strpos(): Empty delimiter in /var/www/htdocs/repository/webdav/lib.php on line 146 
      {"dynload":true,"nosearch":true,"nologin":true,"path":[{"name":"WebDAV","path":0}],"list":[{"title":"test","thumbnail"...

      From what I can tell, if the path is just a single slash '/' path will end up being an empty string as the line before is:

      $path = rtrim($path,'/');

      This doesn't seem to affect 2.3 following the changes made in http://tracker.moodle.org/browse/MDL-32497.

      Sorry I can't provide any more information!

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

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

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    12/Nov/12