Comments

internetdevels’s picture

Status: Active » Needs review
StatusFileSize
new3.55 KB

Looks like $request does not contain account in some cases, so I've used \Drupal::request(), not sure where I should look to fix this.

andypost’s picture

+++ b/core/modules/aggregator/aggregator.pages.inc
@@ -144,7 +144,8 @@ function aggregator_load_feed_items($type, $data = NULL, $limit = 20) {
+  $account = Drupal::request()->attributes->get('_account');

@@ -457,7 +458,9 @@ function template_preprocess_aggregator_feed_source(&$variables) {
+  $account = Drupal::request()->attributes->get('_account');

+++ b/core/modules/aggregator/lib/Drupal/aggregator/Access/CategoriesAccessCheck.php
@@ -45,9 +45,8 @@ public function appliesTo() {
+    $account = \Drupal::request()->attributes->get('_account');

+++ b/core/modules/aggregator/lib/Drupal/aggregator/Plugin/Block/AggregatorCategoryBlock.php
@@ -38,7 +38,8 @@ public function settings() {
+    $account = \Drupal::request()->attributes->get('_account');

+++ b/core/modules/aggregator/lib/Drupal/aggregator/Plugin/Block/AggregatorFeedBlock.php
@@ -38,7 +38,8 @@ public function settings() {
+    $account = \Drupal::request()->attributes->get('_account');

Use Drupal::currentUser() service https://drupal.org/node/2032447

internetdevels’s picture

New patch attached.

andypost’s picture

Status: Needs review » Postponed
  1. +++ b/core/modules/aggregator/lib/Drupal/aggregator/Access/CategoriesAccessCheck.php
    @@ -44,10 +45,9 @@ public function appliesTo() {
    -  public function access(Route $route, Request $request) {
    ...
    +  public function access(Route $route, Request $request, AccountInterface $account = NULL) {
    +    $account = is_null($account) ? \Drupal::currentUser() : $account;
    

    Postponed til #2048223: Add $account argument to AccessCheckInterface::access() method and use the current_user service

  2. +++ b/core/modules/aggregator/lib/Drupal/aggregator/Plugin/Block/AggregatorCategoryBlock.php
    @@ -37,7 +37,7 @@ public function settings() {
    +    return \Drupal::currentUser()->hasPermission('access news feeds');
    
    +++ b/core/modules/aggregator/lib/Drupal/aggregator/Plugin/Block/AggregatorFeedBlock.php
    @@ -37,7 +37,7 @@ public function settings() {
    +    return \Drupal::currentUser()->hasPermission('access news feeds');
    

    This should be proper service injection

internetdevels’s picture

Second point is done.

ParisLiakos’s picture

Issue summary: View changes
Status: Postponed » Needs work
andypost’s picture

Status: Needs work » Reviewed & tested by the community
StatusFileSize
new605 bytes

The one one hunk left

andypost’s picture

Issue tags: +Quick fix

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 7: drupal-aggregator_replace_user_access-2061969-7.patch, failed testing.

andypost’s picture

Status: Needs work » Needs review

The last submitted patch, 5: drupal-aggregator_replace_user_access-2061969-5.patch, failed testing.

Status: Needs review » Needs work

The last submitted patch, 7: drupal-aggregator_replace_user_access-2061969-7.patch, failed testing.

ParisLiakos’s picture

Status: Needs work » Needs review
ParisLiakos’s picture

Status: Needs review » Reviewed & tested by the community

thank you bot -.-

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed to 8.x. Thanks!

Status: Fixed » Closed (fixed)

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