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

single_button ignores slasharguments of a moodle_url

    XMLWordPrintable

Details

    • Bug
    • Status: Development in progress
    • Major
    • Resolution: Unresolved
    • 3.3.1, 3.4
    • None
    • Themes

    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

              Unassigned Unassigned
              jan.dagefoerde Jan Dageförde
              Jan Dageförde Jan Dageförde
              Huong Nguyen, Bas Brands, Mathew May
              Votes:
              3 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated: