Fork of #2595695: 4xx handling using subrequests: no longer able to vary by URL

The conversion of _form being in a request listener means it doesn't happen as part of routing, per se. That causes an issue for subrequests and cache contexts, as seen in #2595695: 4xx handling using subrequests: no longer able to vary by URL. The various entity magic keys are handled with a RouteEnhancer, which is part of routing.

So let's make _form do that, too. There should be no API change here, other than implicitly fixing a bug in #2595695: 4xx handling using subrequests: no longer able to vary by URL in a nicer way. (It's probably also immeasurably faster.)

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Crell created an issue. See original summary.

dawehner’s picture

Closing all the

  1. +++ b/core/lib/Drupal/Core/Routing/Enhancer/FormRouteEnhancer.php
    @@ -0,0 +1,33 @@
    +/**
    + * Contains Drupal\Core\Routing\Enhancer\FormRouteEnhancer.
    + */
    

    nitpick: @file, but note: #2304909: Relax requirement for @file when using OO Class or Interface per file is RTBC FUCK YEAH!!!!!!!!!!!!!!!!!!!!!!!!!

  2. +++ b/core/lib/Drupal/Core/Routing/Enhancer/FormRouteEnhancer.php
    @@ -0,0 +1,33 @@
    +   * @inheritDoc
    ...
    +   * @inheritDoc
    

    Don't we use {@inheritdoc}
    Did you typed that out, or is this coming from somewhere automatically?

  3. +++ b/core/lib/Drupal/Core/Routing/Enhancer/FormRouteEnhancer.php
    @@ -0,0 +1,33 @@
    diff --git a/sites/default/default.settings.php b/sites/default/default.settings.php
    
    diff --git a/sites/default/default.settings.php b/sites/default/default.settings.php
    index 1a6d148..b1f95e2 100644
    
    index 1a6d148..b1f95e2 100644
    --- a/sites/default/default.settings.php
    
    --- a/sites/default/default.settings.php
    +++ b/sites/default/default.settings.php
    
    +++ b/sites/default/default.settings.php
    +++ b/sites/default/default.settings.php
    @@ -223,24 +223,22 @@
    

    Meh, out of scope

Wim Leers’s picture

Assigned: Unassigned » Wim Leers
FileSize
2.57 KB

First rerolling without the default.settings.php changes.

Wim Leers’s picture

Ugh, forgot to include the new file.

Wim Leers’s picture

Assigned: Wim Leers » Unassigned
FileSize
3.61 KB
1.15 KB

#2 all fixed, and fixed additional nitpicks too.

Also: #2304909: Relax requirement for @file when using OO Class or Interface per file <3 <3 <3 YES!!

The last submitted patch, 3: 2595695-move-form-3.patch, failed testing.

Crell’s picture

Eh, sorry for the jitter. It's been a while since I rolled a Drupal patch rather than a PR on something. :-P But yes, let's do!

dawehner’s picture

Status: Needs review » Reviewed & tested by the community
+++ /dev/null
@@ -1,48 +0,0 @@
- *   https://www.drupal.org/node/2092647 has landed.

Yeah, one less todo :)

tim.plunkett’s picture

catch’s picture

Issue tags: +rc target

This blocks #2595695: 4xx handling using subrequests: no longer able to vary by URL which is an RC target.

It removes a service which theoretically someone could rely on, but as of this morning, event subscribers are treated as @internal per https://www.drupal.org/node/2562903/.

It's a real shame we didn't do #2350491: Discuss/implement our usage of private services then it would not even be a question of whether someone's using it or not except for subclassing - I've just re-opened that issue since I can't find the issue it was marked duplicate of.

catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 8.0.x, thanks!

  • catch committed 7e3042e on 8.1.x
    Issue #2613034 by Wim Leers, Crell: Use a route enhancer to handle _form...
Crell’s picture

#11 says this was committed to 8.0.x, meaning it should be in today's 8.0.0 tag. The automated message in #12, though, says it's for 8.1.x. Where'd it go? :-)

tim.plunkett’s picture

http://cgit.drupalcode.org/drupal/commit/?id=7e3042e
This was committed while the git server was being worked on.

Status: Fixed » Closed (fixed)

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