Closed (duplicate)
Project:
Drupal core
Version:
9.1.x-dev
Component:
node system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
1 Mar 2016 at 08:21 UTC
Updated:
23 Jul 2020 at 23:55 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
dawehnerComment #3
catchfwiw based on the discussion in #2678492: Convert the node revision converter to the generic entity one I'd be OK with the change in a minor release, but it feels like something for 8.2.x when that branch is open. That gives us plenty of time to revert or for affected modules to update if the theoretical API change turns out to be a real one.
Comment #6
amateescu commentedLet's give this a try :)
Comment #7
dawehnerI just ask myself whether this is okay API break. Code on that page which uses
$route_match->getParameter('node_revision')would now get an object instead of the ID.Comment #8
amateescu commentedWell, if it's not ok, than this issue is won't fix.
Comment #9
dawehnerYeah, let's ask catch.
Comment #10
pfrenssenFixing this would break B/C, but leaving this unfixed breaks stuff too. This inconsistency is currently breaking contrib. OG has a context provider that loops over the entity link templates and resolves the entity from the route. This works great for all core routes, except for the node revision routes because they are not upcasting correctly, it gets a string ID where it expects an entity :(
Ref. https://github.com/Gizra/og/blob/8.x-1.x/src/OgRouteGroupResolverBase.ph...
Comment #11
pfrenssen@catch mentioned in comment #3 that he would be fine with this being fixed in a minor release. That's a very long time ago though. @catch can you confirm your comment or do we postpone until 9.0.0?
Comment #12
catchI still think it's OK to fix this, it's not part of the public API, and as #10 shows the existing behaviour breaks some expectations anyway.
Comment #15
amateescu commentedSo.. given #12, I think we're good for RTBC here?
Comment #16
timmillwood@amateescu - yes, looks good to me!
Comment #18
amateescu commentedThe patch needed a reroll for the conversion to short array syntax.
Comment #19
dawehner+1 based upon #12
Comment #20
larowlanCan we get a change notice here? In particular pointing out the change to route match.
Comment #21
amateescu commented@larowlan, not sure what you mean, which route match is changed by this patch?
Comment #22
larowlanSorry, see comment 7
Comment #23
jhedstromI just stumbled across this issue when I realized that the
nodeparameter was not being converted to an object on the revision route. Can that also be addressed here, or should that be a new issue? That seemed like more of a bug to me since the route clearly defines{node}in the path.The change to the patch to convert that to an object is as simple as:
Comment #24
jhedstromAdding the fix mentioned in #23 for now. This can be ignored if folks think a follow-up is better (and then 18 is still RTBC with a change notice).
Comment #25
hchonovI think as well that we should have a change notice about the route match parameter being entity now, but I don't consider it as BC break, because usually when a raw parameter is to be retrieved then one should use
\Drupal\Core\Routing\RouteMatchInterface::getRawParameter()instead of\Drupal\Core\Routing\RouteMatchInterface::getParameter()which by definition is returningthe processed value of a named route parameter.Comment #28
steven spasbo commentedComment #30
kevin.dutra commentedRe-roll for 8.8.x
Comment #32
avpadernoComment #33
johnwebdev commentedAdded change record: https://www.drupal.org/node/3093408
Comment #35
jibranClosing this as a duplicate of #2730631: Upcast node and node_revision parameters of node revision routes as the patch there has test and issue has more followers as well. I'll transfer the credit from here over there.
Comment #36
jibranMarking change notice as duplicate as well of https://www.drupal.org/node/2942013.