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

Intro and introfiles URLs don't match in some get_MOD_by_courses

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 3.0.7, 3.1.3
    • 3.0.6, 3.1.2, 3.2
    • Wiki (2.x)
    • MOODLE_30_STABLE, MOODLE_31_STABLE, MOODLE_32_STABLE
    • MOODLE_30_STABLE, MOODLE_31_STABLE
    • MDL-56019-master
    • 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 .

      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.

            dpalou Dani Palou
            dpalou Dani Palou
            Juan Leyva Juan Leyva
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Simey Lameze Simey Lameze
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.