Moodle
  1. Moodle
  2. MDL-33934 META: Issues with MyMobile theme
  3. MDL-32980

MyMobile theme - on any Safari iOS 5.1.1 - error on resources with flag "force download"

    Details

    • Type: Sub-task Sub-task
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.2.2, 2.2.3
    • Fix Version/s: None
    • Component/s: Themes
    • Labels:
    • Environment:
      ipad 2/3 , iphone 4/4s on iOS 5.1.1
    • Database:
      Any
    • Testing Instructions:
      Hide

      Create a course with a single pdf file with the flag "force download", login with a student user, click on the resource, click back in the browser and refresh the page.

      A blank page is displayed (can't do anything else then closing the browser) and this error can be seen in debug mode.

      Javascript error:
      SECURITY_ERR: DOM Exception 18: An attempt was made to break through the security policy of the user agent.

      Show
      Create a course with a single pdf file with the flag "force download", login with a student user, click on the resource, click back in the browser and refresh the page. A blank page is displayed (can't do anything else then closing the browser) and this error can be seen in debug mode. Javascript error: SECURITY_ERR: DOM Exception 18: An attempt was made to break through the security policy of the user agent.
    • Workaround:
      Hide

      Remove the force download flag

      Show
      Remove the force download flag
    • Affected Branches:
      MOODLE_22_STABLE
    • Rank:
      40151

      Description

      This error happens on Safari with iOS 5.1.1 (ipad or iphone)

      Create a course with a single pdf file with the flag "force download", login with a student user, click on the resource, click back in the browser and refresh the page.

      A blank page is displayed (can't do anything else then closing the browser) and this error can be seen in debug mode.

      Javascript error:
      SECURITY_ERR: DOM Exception 18: An attempt was made to break through the security policy of the user agent.

        Activity

        Hide
        Mary Evans added a comment - - edited

        Hi Steve-O,

        Thank you for reporting this problem you are experiencing with MyMobile, but can you tell me if this only affects Safari, in other words does it work OK in all the other browsers or have you not tested it?

        In the mean time I'll hand this over to John Stabinger who maintains this theme.

        Show
        Mary Evans added a comment - - edited Hi Steve-O, Thank you for reporting this problem you are experiencing with MyMobile, but can you tell me if this only affects Safari, in other words does it work OK in all the other browsers or have you not tested it? In the mean time I'll hand this over to John Stabinger who maintains this theme.
        Hide
        Mary Evans added a comment -

        @John

        I've just passed MDL-32980 over to you.

        Show
        Mary Evans added a comment - @John I've just passed MDL-32980 over to you.
        Hide
        Steve-O added a comment -

        not tested sorry, I have only safari on these devices.

        Show
        Steve-O added a comment - not tested sorry, I have only safari on these devices.
        Hide
        John Stabinger added a comment -

        I'm not seeing this issue. Tested on ios4 and ios5 with force download set in the file options for a regular pdf. The pdf just opens in a new window. Close the window, then I go back to the last window.

        Is this an issue with the specific file you were trying? Maybe safari could not open that specific file (hence the problem). I can imagine that safari would choke on files (or file types) that it cannot open. Nothing I can do from the theme about that.

        Show
        John Stabinger added a comment - I'm not seeing this issue. Tested on ios4 and ios5 with force download set in the file options for a regular pdf. The pdf just opens in a new window. Close the window, then I go back to the last window. Is this an issue with the specific file you were trying? Maybe safari could not open that specific file (hence the problem). I can imagine that safari would choke on files (or file types) that it cannot open. Nothing I can do from the theme about that.
        Hide
        Steve-O added a comment -

        hello, thx for your time!

        I just tried to update to the latest Moodle 2.2.3+ (Build: 20120612) but I continue to have the problem.

        as teacher:
        1 add a resource
        2 choose file
        3 upload a pdf (any)
        4 select force download
        5 save

        as student with any ios5.1.1 (on previous versions I never had problems)
        click on the resource
        the file works perfectly I can read it and save it
        click back on the browser
        click refresh or try to navigate in the course
        -> blank page

        christian

        Show
        Steve-O added a comment - hello, thx for your time! I just tried to update to the latest Moodle 2.2.3+ (Build: 20120612) but I continue to have the problem. as teacher: 1 add a resource 2 choose file 3 upload a pdf (any) 4 select force download 5 save as student with any ios5.1.1 (on previous versions I never had problems) click on the resource the file works perfectly I can read it and save it click back on the browser click refresh or try to navigate in the course -> blank page christian
        Hide
        John Stabinger added a comment -

        There is no fix in 223, so updating would not help. As noted though, I cannot recreate this. Sorry, I simply cannot see the issue. Note that you should not have to click back on the browser as the force download should open it in a new window (so there is nothing to go back to). I have tested on multiple IOS devices (both real and virtual) and this does not happen for me.

        Show
        John Stabinger added a comment - There is no fix in 223, so updating would not help. As noted though, I cannot recreate this. Sorry, I simply cannot see the issue. Note that you should not have to click back on the browser as the force download should open it in a new window (so there is nothing to go back to). I have tested on multiple IOS devices (both real and virtual) and this does not happen for me.
        Hide
        Steve-O added a comment -

        If you want I can send you a user-pass for my test installation and you can check if it happens in your iphone or not... I tested it with 5 different devices (ipad/iphone) and 3 different moodle 2.2.x

        in all my devices it doesn't open it in a new tab/window but in the same (that's the problem)

        Show
        Steve-O added a comment - If you want I can send you a user-pass for my test installation and you can check if it happens in your iphone or not... I tested it with 5 different devices (ipad/iphone) and 3 different moodle 2.2.x in all my devices it doesn't open it in a new tab/window but in the same (that's the problem)
        Hide
        Steve-O added a comment -

        I just sent you an account to your gmail account.

        Show
        Steve-O added a comment - I just sent you an account to your gmail account.
        Hide
        John Stabinger added a comment -

        Are you sure you have it set to force download? I do not think you do. Here is how file URLs set to force download look:

        <a href="http://newschooldemo.com/moodle/20/mod/resource/view.php?id=97" onclick="window.open('http://newschooldemo.com/moodle/20/pluginfile.php/148/mod_resource/content/4/Chromebooks_for_Education.pdf?forcedownload=1'); return false;">

        Here is how your URL looks:
        <a href="http://vmelab11.usilu.net/moodle22/mod/resource/view.php?id=3">

        So I'm not sure you have this set to force download, or how you have this set at all. Nevertheless, even as is, it worked fine for me (but opened in the same window).

        Show
        John Stabinger added a comment - Are you sure you have it set to force download? I do not think you do. Here is how file URLs set to force download look: <a href="http://newschooldemo.com/moodle/20/mod/resource/view.php?id=97" onclick="window.open('http://newschooldemo.com/moodle/20/pluginfile.php/148/mod_resource/content/4/Chromebooks_for_Education.pdf?forcedownload=1'); return false;"> Here is how your URL looks: <a href="http://vmelab11.usilu.net/moodle22/mod/resource/view.php?id=3"> So I'm not sure you have this set to force download, or how you have this set at all. Nevertheless, even as is, it worked fine for me (but opened in the same window).
        Hide
        Steve-O added a comment -

        I just sent you a teacher account

        I'm sorry but in all the devices I tested it's not working (5 different iphones/ipads from 5 different people) and in all my production or testing platforms

        Are you using the latest iOS 5.1.1 and Safari?
        The moodle instance I sent you it's a fresh 2.2.3+ with mymobile set as default theme for mobile and tablets.

        Sorry but I have no idea how to replicate this problem

        In my case I just told the teachers to not use force download.

        Show
        Steve-O added a comment - I just sent you a teacher account I'm sorry but in all the devices I tested it's not working (5 different iphones/ipads from 5 different people) and in all my production or testing platforms Are you using the latest iOS 5.1.1 and Safari? The moodle instance I sent you it's a fresh 2.2.3+ with mymobile set as default theme for mobile and tablets. Sorry but I have no idea how to replicate this problem In my case I just told the teachers to not use force download.
        Hide
        John Stabinger added a comment -

        Yes, IOS 5.1+. I think there is a setting, or user setting that is incorrect on your site. Like I noted above, force download URLs should look like I posted, yours do not. So I think it is a setting (or user setting) somewhere that you changed.

        I can't replicate it in any install I tested on.

        Show
        John Stabinger added a comment - Yes, IOS 5.1+. I think there is a setting, or user setting that is incorrect on your site. Like I noted above, force download URLs should look like I posted, yours do not. So I think it is a setting (or user setting) somewhere that you changed. I can't replicate it in any install I tested on.
        Hide
        Steve-O added a comment -

        I just installed a fresh 2.2.3+ and the link is alwais the same, and I alwais have the same error

        you have to click on refresh after clicking on the back button.

        Show
        Steve-O added a comment - I just installed a fresh 2.2.3+ and the link is alwais the same, and I alwais have the same error you have to click on refresh after clicking on the back button.

          People

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

            Dates

            • Created:
              Updated: