- 🇺🇸United States smustgrave
This issue is being reviewed by the kind folks in Slack, #needs-review-queue-initiative. We are working to keep the size of Needs Review queue [2700+ issues] to around 400 (1 month or less), following Review a patch or merge request → as a guide.
Couldn't find the meta but this would fall under replacing service calls with dependency injections one.
- Status changed to Needs work
almost 2 years ago 11:56am 9 March 2023 - 🇮🇳India sahil.goyal
Addressed #12 as per that updating patch and attaching the inter_diff along.
- Status changed to Needs review
almost 2 years ago 1:59pm 12 March 2023 - 🇮🇳India Ranjit1032002
Addressed #12 as per that updating patch and attaching the inter_diff along.
The last submitted patch, 14: 3039354-14.patch, failed testing. View results →
- Status changed to Needs work
almost 2 years ago 1:16pm 13 March 2023 - 🇵🇱Poland Krzysztof Domański Poland
@Ranjit1032002
if ($currentUser === NULL) { @trigger_error... $current_user = \Drupal::currentUser(); } $this->currentUser = $current_user;
- Assigned to Abhisheksingh27
- Issue was unassigned.
- Status changed to Needs review
almost 2 years ago 6:05am 14 March 2023 - Status changed to Needs work
almost 2 years ago 12:13pm 14 March 2023 - 🇵🇱Poland Krzysztof Domański Poland
Change record https://www.drupal.org/node/3347878 →
- 🇵🇱Poland Krzysztof Domański Poland
1/ Naming conventions should be consistent throughout the code. Change $currentUser to $current_user.
public function __construct(array $configuration, $plugin_id, $plugin_definition, AccountProxyInterface $currentUser = NULL) {
2/ It should be more descriptive.
+ /** + * CurrentUser. + * + * @var \Drupal\Core\Session\AccountProxyInterface + */ + protected $currentUser; + + /** + * CurrentUser constructor.
- Status changed to Needs review
almost 2 years ago 2:20pm 14 March 2023 - 🇮🇳India TanujJain-TJ
Updated the patch as per #21 & #22, please review.
- Status changed to Needs work
almost 2 years ago 4:23pm 16 March 2023 - 🇺🇸United States smustgrave
Will need a simple deprecation test to ensure the message is returned correctly
- 🇺🇸United States drupgirl
This patch was working great, but it no longer applies to 10.3.1 resulting in the following error that prevents the upgrade.
Fatal error: Could not check compatibility between Drupal\user\Plugin\views\argument_default\CurrentUser::create(Drupal\user\Plugin\views\argument_default\ContainerInterface $container, arr
ay $configuration, $plugin_id, $plugin_definition) and Drupal\views\Plugin\views\PluginBase::create(Symfony\Component\DependencyInjection\ContainerInterface $container, array $configuration
, $plugin_id, $plugin_definition), because class Drupal\user\Plugin\views\argument_default\ContainerInterface is not available in .../web/core/modules/user/src/Plugin/views/argument_default/CurrentUser.php on line 53 - 🇺🇸United States drupgirl
Oh so the only part of the patch that is needed for 10.3 is this. Once applied the update works.
diff --git a/core/modules/user/src/Plugin/views/argument_default/CurrentUser.php b/core/modules/user/src/Plugin/views/argument_default/CurrentUser.php
index 251d47198b..b0c11febe4 100644
--- a/core/modules/user/src/Plugin/views/argument_default/CurrentUser.php
+++ b/core/modules/user/src/Plugin/views/argument_default/CurrentUser.php
@@ -4,7 +4,9 @@use Drupal\Core\Cache\Cache;
use Drupal\Core\Cache\CacheableDependencyInterface;
+use Drupal\Core\Session\AccountProxyInterface;
use Drupal\views\Plugin\views\argument_default\ArgumentDefaultPluginBase;
+use Symfony\Component\DependencyInjection\ContainerInterface; - Assigned to zniki.ru
- 🇷🇺Russia zniki.ru
That's great I found this issue, because I wasn't sure if DI should be used here.
I will update patch, update message, add deprecation test and move from patch to MR approach. - 🇷🇺Russia zniki.ru
Mark curent_user param as nullable.
MR is ready for review. - 🇷🇺Russia zniki.ru
Thanks again for your feedback. I made changes, MR is ready for review.
Introduce return type hinting for create() is better at 🌱 [Meta] Implement strict typing in existing code Active .
- 🇷🇺Russia zniki.ru
I update deprecation test, because after changing currentUser to property promotion unit test failed.
Should we add type hinting for property or skip for now and add only at D12? - 🇷🇺Russia zniki.ru
I hide all patch files.
MR updated: move deprecation test to user module. - 🇺🇸United States smustgrave
Will agree with the static return.
Rest of the feedback appers to be addressed.
-
alexpott →
committed 6728ca19 on 11.x
Issue #3039354 by nikolay shapovalov, tanuj., ranjit1032002,...
-
alexpott →
committed 6728ca19 on 11.x
- 🇷🇺Russia zniki.ru
Great job, thanks for merging.
It looks like we forgot to change argument name at deprecation message.
without the $current_user argument
But at construct
protected ?AccountInterface $currentUser = NULL
- 🇬🇧United Kingdom alexpott 🇪🇺🌍
@nikolay shapovalov I committed a quick follow-up to fix this.
-
alexpott →
committed 91de3017 on 11.x
Issue #3039354 follow-up by nikolay shapovalov: The current user views...
-
alexpott →
committed 91de3017 on 11.x