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

URL activity link doesn't automatically redirect in main menu block

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.2
    • Fix Version/s: STABLE backlog
    • Component/s: Resource
    • Labels:
    • Testing Instructions:
      Hide

      add a URL to the main menu block on the site homepage - set it to automatic.
      Click on the link in the main menu block - make sure it auto redirects to the page and doesn't show an intermediary splash page.

      Show
      add a URL to the main menu block on the site homepage - set it to automatic. Click on the link in the main menu block - make sure it auto redirects to the page and doesn't show an intermediary splash page.
    • Affected Branches:
      MOODLE_22_STABLE

      Description

      Noticed this issue while testing for MDL-29224.

      Sam's comment for the issue:
      The site main menu block in master uses $cm->extra however in master the onclick is handled properly and the site main menu block needs to use both $cm->extra and $cm->get_on_click(). To the developer have a look at what print_section does.

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            normansj Sam Norman added a comment - - edited

            Is there a fix to this issue, I seem to have the same issue where url links are going to an activity page that is requiring the user to click on a further link to access the url? Is there a workaround to this issue if no fix?

            Cheers,

            Sam Norman

            Show
            normansj Sam Norman added a comment - - edited Is there a fix to this issue, I seem to have the same issue where url links are going to an activity page that is requiring the user to click on a further link to access the url? Is there a workaround to this issue if no fix? Cheers, Sam Norman
            Hide
            mwilday Mike Wilday added a comment -

            This affects 2.3 as well. We are having no luck getting html links to open in a new window, pop-up window, etc. They all open a moodle page where it re-displays the link and allows you to click on it again to perform whichever action you were wanting. Any chance this is going to be fixed?

            Show
            mwilday Mike Wilday added a comment - This affects 2.3 as well. We are having no luck getting html links to open in a new window, pop-up window, etc. They all open a moodle page where it re-displays the link and allows you to click on it again to perform whichever action you were wanting. Any chance this is going to be fixed?
            Hide
            samhemelryk Sam Hemelryk added a comment -

            I've just had a look at this now, it is still the case.

            Petr I made you the assignee as I suspect you can answer the next question.
            I looked at how the URL module is works out how to handle a URL set to automatic and found that text/html is set to download.
            I'm guessing there is a good reason for this, do you happen to know it?

            Many thanks
            Sam

            Show
            samhemelryk Sam Hemelryk added a comment - I've just had a look at this now, it is still the case. Petr I made you the assignee as I suspect you can answer the next question. I looked at how the URL module is works out how to handle a URL set to automatic and found that text/html is set to download. I'm guessing there is a good reason for this, do you happen to know it? Many thanks Sam
            Hide
            skodak Petr Skoda added a comment -

            Hi, I suppose the correct automatic way now is to use iframe, my +1 to use it by default in moodle 2.5

            Show
            skodak Petr Skoda added a comment - Hi, I suppose the correct automatic way now is to use iframe, my +1 to use it by default in moodle 2.5
            Hide
            mwilday Mike Wilday added a comment -

            This affects not only the auto option - but whichever action you set for the URL in the main Menu block... embed, pop-up, etc. All URL open actions function the same way when you click on the link in the main menu block. It goes to a moodle page with the link.

            Show
            mwilday Mike Wilday added a comment - This affects not only the auto option - but whichever action you set for the URL in the main Menu block... embed, pop-up, etc. All URL open actions function the same way when you click on the link in the main menu block. It goes to a moodle page with the link.
            Hide
            skodak Petr Skoda added a comment -

            I wrote the original code in 2.0 only, the url launching was reworked a few times later.

            SamM: You work on both media and modinfo, any idea how it is supposed to work in current stable branches?

            Show
            skodak Petr Skoda added a comment - I wrote the original code in 2.0 only, the url launching was reworked a few times later. SamM: You work on both media and modinfo, any idea how it is supposed to work in current stable branches?
            Hide
            quen Sam Marshall added a comment -

            There is an ->onclick data element in modinfo, it is supposed to use that now. block_site_main_menu still uses ->extra which is the old one that we got rid of. (Think we may have had both in place for compatibility for a bit...)

            Somebody else rewrote this a bit since I did, too I think the relevant code is navigationlib.php line 1915 in load_section_activities (it has been changed to make a fancy function and not just literally output as the onclick attribute).

            Show
            quen Sam Marshall added a comment - There is an ->onclick data element in modinfo, it is supposed to use that now. block_site_main_menu still uses ->extra which is the old one that we got rid of. (Think we may have had both in place for compatibility for a bit...) Somebody else rewrote this a bit since I did, too I think the relevant code is navigationlib.php line 1915 in load_section_activities (it has been changed to make a fancy function and not just literally output as the onclick attribute).

              People

              • Votes:
                1 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated: