Closed (fixed)
Project:
Drupal core
Version:
10.1.x-dev
Component:
routing system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
19 Feb 2023 at 16:29 UTC
Updated:
18 Oct 2023 at 11:28 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
andypostCR and initial patch, as there's contrib usage CR needs to be updated for
Url::renderAccess()(marked@internalATM)Comment #3
andypostThere's access check few lines above so no need for
$render_array['#access_callback'] = [get_class(), 'renderAccess'];Comment #4
andypostand now
unset()no longer neededComment #5
catchI checked the contrib usages, they are all doing:
if ($url->renderAccess($url->toRenderArray()))Which seems like an extremely long way to do:
if ($url->access())There are only two modules with a couple of usages each, so I think we could go ahead and deprecate both methods here.
Comment #6
andypostUpdated CR https://www.drupal.org/node/3342977
and new patch with todo link for removal #3343153: Remove deprecated code from \Drupal\Core\Url
Comment #7
andypostbetter title
Comment #8
andypostFix CS for deprecation
Comment #9
catchMaybe 'There is no direct replacement' instead of 'inline its implementation? - The uses in contrib should be refactored to something else entirely.
Same here.
Comment #10
andypostThanks, changed to suggested
Comment #11
andypostCR updated
Comment #12
catchThe example in the CR is clear and covers literally every usage in contrib.
I think this is ready to go now.
Comment #13
rohan-sinha commentedReviewed Patch on #10, issue has been resolved as observed, can be merged.
Comment #14
quietone commentedThe deprecation message for a method does not start with 'The'. And I was getting a phpcs errors. So, I updated the patch.
I also too the liberty of removing 'direct' from the deprecation message. It did not seem to be adding information.
Comment #15
andypostThank you, curious why phpcs does not report it in CI
Comment #17
longwaveCommitted and pushed to 10.1.x, thanks!
Comment #19
pcambraI know I'm late to the party, but why is toRenderArray deprecated? I only see the access method discussed.