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

Intro and introfiles URLs don't match in some get_MOD_by_courses

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.0.6, 3.1.2, 3.2
    • Fix Version/s: 3.0.7, 3.1.3
    • Component/s: Wiki (2.x)
    • Labels:
    • Testing Instructions:
      Hide
      1. Create a course with a student.
      2. Create a wiki and add an image in its description.
      3. Enable "Mobile services": Plugins ► Web Services ► Mobile
      4. Create a Token for the student:
        • Click on Site administration ► Plugins ► Web services ► Manage tokens
      5. Next, you can do a CURL REST call simulating a WS client with the student user
        • You need to replace the wstoken and the URL of your moodle instance:

          curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'wsfunction=mod_wiki_get_wikis_by_courses&wstoken=ffbe3a3002f235bf9d01fd9369e10b66' --compressed

      6. Confirm that the image URL is exactly the same in fields intro and introfiles.
      7. Perform the same test with forum, scorm and lti using the WebServices: mod_forum_get_forums_by_courses, mod_scorm_get_scorms_by_courses and mod_lti_get_ltis_by_courses.
      Show
      Create a course with a student. Create a wiki and add an image in its description. Enable "Mobile services": Plugins ► Web Services ► Mobile Create a Token for the student: Click on Site administration ► Plugins ► Web services ► Manage tokens Next, you can do a CURL REST call simulating a WS client with the student user You need to replace the wstoken and the URL of your moodle instance: curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'wsfunction=mod_wiki_get_wikis_by_courses&wstoken=ffbe3a3002f235bf9d01fd9369e10b66' --compressed Confirm that the image URL is exactly the same in fields intro and introfiles . Perform the same test with forum, scorm and lti using the WebServices: mod_forum_get_forums_by_courses , mod_scorm_get_scorms_by_courses and mod_lti_get_ltis_by_courses .
    • Affected Branches:
      MOODLE_30_STABLE, MOODLE_31_STABLE, MOODLE_32_STABLE
    • Fixed Branches:
      MOODLE_30_STABLE, MOODLE_31_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-56019-master

      Description

      I have a wiki with an image in the description. If I call the WS get_wikis_by_courses I receive different URLs for the image.

      In intro: ../mod_wiki/intro/2/Autout_200.png
      In introfiles: .../mod_wiki/intro/Autout_200.png

      The reason is that, in the WS, we pass $wiki->id as itemid when calling external_format_text and we shouldn't do that. We should pass null as it's done in format_module_intro.

      I checked the other modules and I've seen there are others with the same problem: forum, lti, scorm.

      In Moodle 3.1 and 3.0 we don't have introfiles, but I still think we should use null in intro for consistency.

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                14/Nov/16