Problem/Motivation

In FormBuilder::formBuilder function the variable $request is assigned twice with the same vaue:

$request = $this->requestStack->getCurrentRequest();

Probably, one call is enough.

Proposed resolution

Remove the second call.

Remaining tasks

Provide patch.

Ready!

User interface changes

None.

API changes

None.

Data model changes

None.

Issue fork drupal-3219541

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

tunic created an issue. See original summary.

tunic’s picture

Status: Active » Needs review

MR created (after w few wrong attempts). Let's see what tests say.

tunic’s picture

Adding the MR patch to trigger tests.

tunic’s picture

Issue summary: View changes
tunic’s picture

Status: Needs review » Reviewed & tested by the community

Given that all tests pass and the commit is trivial I'll be bold and move it to RTBC.

longwave’s picture

You shouldn't set your own patch to RTBC :)

But this is small and simple, the $request variable is set exactly the same way at the top of the method so this line is redundant, therefore this is RTBC.

tunic’s picture

Title: Remove redudante call $this->requestStack->getCurrentRequest() in FormBuilder::buildForm » Remove redudant call $this->requestStack->getCurrentRequest() in FormBuilder::buildForm

You are right, I should not set RTBC on my own patches... but it was so trivial that I broke the law this time.

Thanks for reviewing :)

longwave’s picture

Title: Remove redudant call $this->requestStack->getCurrentRequest() in FormBuilder::buildForm » Remove redundant call $this->requestStack->getCurrentRequest() in FormBuilder::buildForm

  • catch committed 8cc548c on 9.3.x
    Issue #3219541 by tunic, longwave: Remove redundant call $this->...
catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 9.3.x, thanks!

Status: Fixed » Closed (fixed)

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