Uploaded image for project: 'Moodle app'
  1. Moodle app
  2. MOBILE-4434

Support absolute URLs without domain in embedded content and link handlers

XMLWordPrintable

    • Hide

      This issue only needs to be tested in 1 device.

      Test links

      To test this part you will need a site served under a path/folder, e.g. domain.com/mysite.

      1. In the site, add a link supported by the app (e.g. a course or activity link) using a relative path from the domain. E.g. if the site URL is domain.com/mysite, the link should be something like /mysite/course/view.php?id=2.
      2. In the app, click the link. Check that the course/activity is opened.

      Test media

      The most likely scenarios for this case would be to put images directly in the server (not using the Moodle filesystem), but since we cannot do that in our testing sites we'll use a workaround to simulate it.

      Please notice that links relative to a subpage (e.g. to the course page) won't work, we have MOBILE-1401 for that.

      1. In a site, include an image in a label/section/page. Please use an image, not a video or audio because the media filter treats the URLs and it doesn't work properly.
      2. Once saved, copy the image URL when viewing it (not in the edit form). It should be something like https://domain.com/pluginfile.php/... and it shouldn't say
      3. Edit the content again, click to view source code and duplicate the image's HTML. In the new image, replace the src with the one you copied but removing the domain, e.g. it should be something like /pluginfile.php/... (or if the site has a subfolder like domain.com/mysite then the URL should be /mysite/pluginfile.php/...).
      4. Save the changes and check that you can see both images in the browser.
      5. In the app, open the content and check that you can see both images.

      Test iframe

      Please notice that links relative to a subpage (e.g. to the course page) won't work, we have MOBILE-1401 for that.

      1. In a site, in a label/section/page add the following HTML: <iframe src="URL" width="100%" height="300px"></iframe>, replacing URL with a relative URL to any page in the site. E.g. /course/view.php?id=2.
      2. In the app, open the content and check that the iframe displays the right page.
      Show
      This issue only needs to be tested in 1 device. Test links To test this part you will need a site served under a path/folder, e.g. domain.com/mysite. In the site, add a link supported by the app (e.g. a course or activity link) using a relative path from the domain. E.g. if the site URL is domain.com/mysite, the link should be something like /mysite/course/view.php?id=2. In the app, click the link. Check that the course/activity is opened. Test media The most likely scenarios for this case would be to put images directly in the server (not using the Moodle filesystem), but since we cannot do that in our testing sites we'll use a workaround to simulate it. Please notice that links relative to a subpage (e.g. to the course page) won't work, we have MOBILE-1401 for that. In a site, include an image in a label/section/page. Please use an image, not a video or audio because the media filter treats the URLs and it doesn't work properly. Once saved, copy the image URL when viewing it (not in the edit form). It should be something like https://domain.com/pluginfile.php/... and it shouldn't say Edit the content again, click to view source code and duplicate the image's HTML. In the new image, replace the src with the one you copied but removing the domain, e.g. it should be something like /pluginfile.php/... (or if the site has a subfolder like domain.com/mysite then the URL should be /mysite/pluginfile.php/...). Save the changes and check that you can see both images in the browser. In the app, open the content and check that you can see both images. Test iframe Please notice that links relative to a subpage (e.g. to the course page) won't work, we have MOBILE-1401 for that. In a site, in a label/section/page add the following HTML: <iframe src="URL" width="100%" height="300px"></iframe> , replacing URL with a relative URL to any page in the site. E.g. /course/view.php?id=2. In the app, open the content and check that the iframe displays the right page.
    • Moodle Apps Sprint 2025-I1.4

      The app is unable to support relative URLs (e.g. ../mod/...) because the origin location depends on the page where the HTML is supposed to be rendered, and that depends on each specific case. However, we can support absolute URLs without domain (e.g. /mod/...) since they only depend on the domain.

      In link handlers we already support links like "/mod/...", but there is a case we don't support: if the site is under a directory and absolute URLs are used for links. E.g. the site is "mysite.com/dir" and the links are "/dir/mod/...".

            dpalou Dani Palou
            dpalou Dani Palou
            Pau Ferrer Pau Ferrer
            Isabel Renedo Rouco Isabel Renedo Rouco
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 days, 5 hours, 27 minutes
                2d 5h 27m

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