Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Split from #2091399: [META] Remove menu_get_object()
Comment | File | Size | Author |
---|---|---|---|
#12 | user_default_argument.2095961-08.patch | 4.33 KB | ekes |
#8 | user_default_argument.2095961-08.patch | 4.33 KB | ekes |
#6 | user_default_argument.2095961.03-06.interdiff.txt | 1.4 KB | ekes |
#6 | user_default_argument.2095961-06.patch | 4.28 KB | ekes |
#3 | user_default_argument.2095961-03.patch | 4.15 KB | ekes |
Comments
Comment #1
ekes CreditAttribution: ekes commentedTwo instances, both in user module, both in views default_argument.
Comment #2
ekes CreditAttribution: ekes commentedAll instances of this (and one of menu_get_object('node')) are in Drupal\user\Plugin\views\argument_default\User::getArgument
cf.
#1817630: Cleanup get_argument() on node/user default argument
#2028505: Provide the request object for ArgumentDefaultPluginBase::getArgument() as argument
Comment #3
ekes CreditAttribution: ekes commentedThe present getArgument(), returns the user object from any path defining user, or one with node and then the related author. This only makes sense in a non-page context (ie not for a conditional argument on a page.)
Attached patch does the same from the route.
It's confusing to say this comes from the URI now - that's more Raw - however the replaced 'route context' is probably not good for usability.
Comment #4
dawehnerIt is great to see that there is some effort behind removing menu_get_object().
Maybe we should first check for the interface just in case maybe someone came to the idea that naming something user is a good idea.
Some with node then.
Comment #5
dawehnerThese two changes should be possible done by a novice.
Comment #6
ekes CreditAttribution: ekes commentedAdd patch with instance check.
Comment #7
dawehnerThank you for the final change.
Comment #8
ekes CreditAttribution: ekes commentedCorrecting the comment.
Comment #10
ekes CreditAttribution: ekes commentedSeems there are issues with the testbot at the moment.
Comment #11
ekes CreditAttribution: ekes commented8: user_default_argument.2095961-08.patch queued for re-testing.
Comment #12
ekes CreditAttribution: ekes commentedRe-upload to force final test.
Comment #13
dawehnerStill like before
Comment #14
catchI don't like that we replaced one magic string with another for getting router arguments, but that's not the fault of this patch. Committed/pushed to 8.x, thanks!