Moodle
  1. Moodle
  2. MDL-37015

Unnecessary blocks (navigation, settings, ..) in pop-up page

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.4
    • Fix Version/s: 2.4.1
    • Component/s: Resource
    • Labels:
    • Testing Instructions:
      Hide

      Test 1

      1. Log in as admin
      2. create a resource url with display set to "pop-up"
      3. log in as student and click on above resource
      4. It should open a new window with site same as "External url" and no browser navigation.

      Test 2

      1. Try test 1 with resource url with display set to "New window"

      test 3

      1. Enable popup in page plugin (Site administration ► Plugins ► Activity modules ► Page)
      2. Create page resource
      3. log in as student and click on page resource
      4. It should open a new window with no blocks.
      Show
      Test 1 Log in as admin create a resource url with display set to "pop-up" log in as student and click on above resource It should open a new window with site same as "External url" and no browser navigation. Test 2 Try test 1 with resource url with display set to "New window" test 3 Enable popup in page plugin (Site administration ► Plugins ► Activity modules ► Page) Create page resource log in as student and click on page resource It should open a new window with no blocks.
    • Affected Branches:
      MOODLE_24_STABLE
    • Fixed Branches:
      MOODLE_24_STABLE
    • Pull 2.4 Branch:
      wip-mdl-37015-m24
    • Pull Master Branch:
      wip-mdl-37015
    • Rank:
      46554

      Description

      If I add a page to a Moodle course an choose "pop-up" as display mode, it open with blocks (navigation, settings, ...) on the left side.
      Thats not what I want (and as it was in ... 2.3). There isn't an option for this or I miss it?

        Issue Links

          Activity

          Hide
          Rajesh Taneja added a comment -

          In course/lib.php, around line 1534. html_writer has been used. Till 2.3 we were just concatenating onclick. Either we can replace html special char here or remove html_special_char in mod/url/lib.php while creating links (Line 270)

          Show
          Rajesh Taneja added a comment - In course/lib.php, around line 1534. html_writer has been used. Till 2.3 we were just concatenating onclick. Either we can replace html special char here or remove html_special_char in mod/url/lib.php while creating links (Line 270)
          Hide
          Sam Marshall added a comment -

          Guess this was just assigned to me by accident - reassigning.

          Show
          Sam Marshall added a comment - Guess this was just assigned to me by accident - reassigning.
          Hide
          Rajesh Taneja added a comment -

          Similar decoding is done in navigation/lib.php - 1925.

          Will open an enhancement issue to use proper JS event handle.

          Show
          Rajesh Taneja added a comment - Similar decoding is done in navigation/lib.php - 1925. Will open an enhancement issue to use proper JS event handle.
          Hide
          Stephan Goeldi added a comment -

          Yes, it works! I've changed course/lib.php and the pop-up windows has no navigation and other blocks. Thanks

          Show
          Stephan Goeldi added a comment - Yes, it works! I've changed course/lib.php and the pop-up windows has no navigation and other blocks. Thanks
          Hide
          Rajesh Taneja added a comment -

          Thanks for testing this, Stephan

          Show
          Rajesh Taneja added a comment - Thanks for testing this, Stephan
          Hide
          Rick Jerz added a comment -

          I just upgraded to 2.4 today, and I am seeing the problem also with both "New Window" and with "Pop Up". Yes, this is a 2.4 problem, not a 2.3 problem (MDL37057). The "New Window" behavior in 2.4 does open another tab, but it should then display the complete webpage. Instead, it is acting like the "Open" option. Using "Pop-up" produces the same misbehavior.

          Show
          Rick Jerz added a comment - I just upgraded to 2.4 today, and I am seeing the problem also with both "New Window" and with "Pop Up". Yes, this is a 2.4 problem, not a 2.3 problem (MDL37057). The "New Window" behavior in 2.4 does open another tab, but it should then display the complete webpage. Instead, it is acting like the "Open" option. Using "Pop-up" produces the same misbehavior.
          Hide
          Rajesh Taneja added a comment -

          Thanks Rick,

          This problem was introduced by MDL-36550 and we will get this fixed soon.

          Show
          Rajesh Taneja added a comment - Thanks Rick, This problem was introduced by MDL-36550 and we will get this fixed soon.
          Hide
          Ash Wright added a comment -

          Hi, is there a fix or a work around for this yet?

          Show
          Ash Wright added a comment - Hi, is there a fix or a work around for this yet?
          Hide
          Rajesh Taneja added a comment -

          Hello Ash,

          There is a patch which is waiting for peer-review. Will check if it can be integrated soon.

          Show
          Rajesh Taneja added a comment - Hello Ash, There is a patch which is waiting for peer-review. Will check if it can be integrated soon.
          Hide
          Ash Wright added a comment -

          Thank you. So desperate for this

          Show
          Ash Wright added a comment - Thank you. So desperate for this
          Hide
          Damyon Wiese added a comment -

          Hi Raj,

          Can you add to the testing instructions a test for mod_page in a popup as it has the same issue?

          Also - can you add these parameters to the call to html_entity_decode function: " ENT_QUOTES, 'UTF-8');"

          The defaults for this changed between php4.3 and 4.4 so it is better to set them (may help not break some chinese url).

          Thanks - Damyon

          Show
          Damyon Wiese added a comment - Hi Raj, Can you add to the testing instructions a test for mod_page in a popup as it has the same issue? Also - can you add these parameters to the call to html_entity_decode function: " ENT_QUOTES, 'UTF-8');" The defaults for this changed between php4.3 and 4.4 so it is better to set them (may help not break some chinese url). Thanks - Damyon
          Hide
          Rajesh Taneja added a comment -

          Thanks Damyon,

          I have fixed this and as discussed added ENT_QUOTES flag in navigationlib as well.

          Show
          Rajesh Taneja added a comment - Thanks Damyon, I have fixed this and as discussed added ENT_QUOTES flag in navigationlib as well.
          Hide
          Damyon Wiese added a comment -

          Adding checklist:

          [Y] Syntax
          [Y] Output
          [Y] Whitespace
          [-] Language
          [-] Databases
          [Y] Testing
          [Y] Security (Checked for XSS issues)
          [-] Documentation
          [Y] Git
          [Y] Sanity check

          Some more comments - this issues was caused by changing the course/lib.php to use renderers in 2.4 so the issue does not exist in 2.3. In 2.3 the modinfo->onclick attribute was being inserted into the links with no additional escaping - because of html_writer they are being passed through s() (in lib/weblib.php) which uses

          htmlspecialchars($blah, ENT_QUOTES, 'UTF-8');

          So to reverse of this is

          htmlspecialchars_decode($blah, ENT_QUOTES);

          Show
          Damyon Wiese added a comment - Adding checklist: [Y] Syntax [Y] Output [Y] Whitespace [-] Language [-] Databases [Y] Testing [Y] Security (Checked for XSS issues) [-] Documentation [Y] Git [Y] Sanity check Some more comments - this issues was caused by changing the course/lib.php to use renderers in 2.4 so the issue does not exist in 2.3. In 2.3 the modinfo->onclick attribute was being inserted into the links with no additional escaping - because of html_writer they are being passed through s() (in lib/weblib.php) which uses htmlspecialchars($blah, ENT_QUOTES, 'UTF-8'); So to reverse of this is htmlspecialchars_decode($blah, ENT_QUOTES);
          Hide
          Sam Hemelryk added a comment -

          Thanks Raj, this has been integrated now.

          Show
          Sam Hemelryk added a comment - Thanks Raj, this has been integrated now.
          Hide
          Sam Hemelryk added a comment -

          Tested during integration review and passed.

          Show
          Sam Hemelryk added a comment - Tested during integration review and passed.
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Did you know that your awesome changes are the last ones landing to CVS?

          After 11 years, 2 months and 8 days... it's ended, died, closed, kaputt. Big thanks to it, has served us really well.

          Closing this as fixed, many thanks!

          Show
          Eloy Lafuente (stronk7) added a comment - Did you know that your awesome changes are the last ones landing to CVS? After 11 years, 2 months and 8 days... it's ended, died, closed, kaputt. Big thanks to it, has served us really well. Closing this as fixed, many thanks!
          Hide
          Rick Jerz added a comment -

          I want to thank everyone who was involved in fixing this problem. I probably don't have to tell you this, but I just downloaded the newest Moodle 2.4+ (Build: 20121230) (2012120300.06), which was just posted 3 hours ago, and your fix is already in the build (since you fixed this earlier today). I tried it and it worked just fine (both my pop-ups and new windows). Great!

          Show
          Rick Jerz added a comment - I want to thank everyone who was involved in fixing this problem. I probably don't have to tell you this, but I just downloaded the newest Moodle 2.4+ (Build: 20121230) (2012120300.06), which was just posted 3 hours ago, and your fix is already in the build (since you fixed this earlier today). I tried it and it worked just fine (both my pop-ups and new windows). Great!
          Hide
          Rick Jerz added a comment - - edited

          Well, I discovered an interesting problem with URL resources that open in a "New Window", Moodle does not honor the "visited link" html appearance changes. I found this problem as I worked with the newest Moodle 2.4 download. I also posted this problem in moodle.org forums (see https://moodle.org/mod/forum/discuss.php?d=218814#p952863). I try to explain the problem to Mary. Somehow, whatever code was used to fix the pop-ups and new-windows, maybe someone forgot to honor the "visited" css code. I hope that I have made the problem clear, but if not, let me know and I can add more to my description.

          I am not sure if you want to re-open this Moodle Tracker number, or if it is better to start a new tracker item.

          Show
          Rick Jerz added a comment - - edited Well, I discovered an interesting problem with URL resources that open in a "New Window", Moodle does not honor the "visited link" html appearance changes. I found this problem as I worked with the newest Moodle 2.4 download. I also posted this problem in moodle.org forums (see https://moodle.org/mod/forum/discuss.php?d=218814#p952863 ). I try to explain the problem to Mary. Somehow, whatever code was used to fix the pop-ups and new-windows, maybe someone forgot to honor the "visited" css code. I hope that I have made the problem clear, but if not, let me know and I can add more to my description. I am not sure if you want to re-open this Moodle Tracker number, or if it is better to start a new tracker item.
          Hide
          Helen Foster added a comment -

          Hi Rick,

          If you've not done so already, please create a new issue for the visited link problem.

          As a general principle, once a Moodle (MDL) issue has been closed, it's better to create a new issue for any related problem (or the problem reoccurring) and link the closed issue to it.

          Show
          Helen Foster added a comment - Hi Rick, If you've not done so already, please create a new issue for the visited link problem. As a general principle, once a Moodle (MDL) issue has been closed, it's better to create a new issue for any related problem (or the problem reoccurring) and link the closed issue to it.

            People

            • Votes:
              7 Vote for this issue
              Watchers:
              12 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: