Problem/Motivation

Drupal\Tests\basic_auth\Traits\BasicAuthTestTrait::basicAuthPostForm() has the following code:

protected function basicAuthPostForm($path, $edit, $submit, $username, $password, array $options = [], $form_html_id = NULL, $extra_post = NULL) {
  return $this->drupalPostForm($path, $edit, $submit, $options, $this->getBasicAuthHeaders($username, $password), $form_html_id, $extra_post);
}

However the signature of drupalPostForm() is:

protected function drupalPostForm($path, $edit, $submit, array $options = [], $form_html_id = NULL) {

ie. the Authorization header is passed as the $form_html_id element, which will not work.

Steps to reproduce

Proposed resolution

The method is never called in core or contrib (no results at http://grep.xnddx.ru/search?text=basicAuthPostForm&filename= ) so I suggest just removing it.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

CommentFileSizeAuthor
#3 3178273.patch1.76 KBlongwave

Comments

longwave created an issue. See original summary.

longwave’s picture

Issue summary: View changes
longwave’s picture

Status: Active » Needs review
StatusFileSize
new1.76 KB
joachim’s picture

Status: Needs review » Reviewed & tested by the community

LGTM.

alexpott’s picture

Title: BasicAuthTestTrait::basicAuthPostForm() does not work » [backport] BasicAuthTestTrait::basicAuthPostForm() does not work
Version: 9.2.x-dev » 9.1.x-dev

Yep this is broken code that we're not using. Will backport once the freeze is over.

Committed f60d258 and pushed to 9.2.x. Thanks!

  • alexpott committed f60d258 on 9.2.x
    Issue #3178273 by longwave: BasicAuthTestTrait::basicAuthPostForm() does...
alexpott’s picture

Title: [backport] BasicAuthTestTrait::basicAuthPostForm() does not work » BasicAuthTestTrait::basicAuthPostForm() does not work
Version: 9.1.x-dev » 8.9.x-dev
Status: Reviewed & tested by the community » Fixed

Backported to 8.9.x because this is dead broken test code.

  • alexpott committed 1e30db1 on 9.1.x
    Issue #3178273 by longwave: BasicAuthTestTrait::basicAuthPostForm() does...

  • alexpott committed 2f4e6f0 on 9.0.x
    Issue #3178273 by longwave: BasicAuthTestTrait::basicAuthPostForm() does...

  • alexpott committed 01d1fec on 8.9.x
    Issue #3178273 by longwave: BasicAuthTestTrait::basicAuthPostForm() does...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.