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

single_button ignores slasharguments of a moodle_url

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Development in progress
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 3.3.1, 3.4
    • Fix Version/s: None
    • Component/s: Themes
    • Labels:

      Description

      I render a single_button object using the core renderer's method render_single_button, i.e. from a mustache template. The single_button is instantiated using a moodle_url object.

      If that moodle_url object is created from a URL that contains slash arguments, the effective target URL of the single_button completely ignores the slash arguments. Example URL: https://demo.nextcloud.com/ogh3roos/index.php/apps/oauth2/authorize

      EXPECTED: A button within a form whose action URL is "https://demo.nextcloud.com/ogh3roos/index.php/apps/oauth2/authorize".

      ACTUAL: A button within a form whose action URL is "https://demo.nextcloud.com/ogh3roos/index.php".

      SAMPLE CODE:

      // with an existing oauth client; must be configured with an issuer that uses slasharguments as its authorization_endpoint:
      $renderer->render(new \single_button($oauthclient->get_login_url(), 'Login'));
      // quick demo without oauth configuration:
      $renderer->render(new \single_button(new \moodle_url("https://demo.nextcloud.com/ogh3roos/index.php/apps/oauth2/authorize"), 'Login'));
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              jan.dagefoerde Jan Dageförde
              Peer reviewer:
              Jan Dageförde
              Participants:
              Component watchers:
              Bas Brands
              Votes:
              3 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated: