Through #1748176-25: Add test coverage for Views user integration. When we use the contextual filters (uid) in the title of one views we get one error for anonymous users. We get Uncategorized instead of the name of anonymous user.

Comments

fastangel’s picture

Status: Active » Needs review
StatusFileSize
new1.24 KB

I attached a new patch for this special case.

damiankloip’s picture

Status: Needs review » Needs work
Issue tags: +Needs tests

This needs some tests added to the ones provided by the referenced issue above then I guess.

damiankloip’s picture

Status: Needs work » Needs review
StatusFileSize
new1.22 KB
new760 bytes

So, maybe we don't need the title override, but the currently patch will not work anyhow.

Not totally sure about this approach, but we could add the anonymous user to the views_data definition, then the current logic will take care of this for us anyway.

Validation welcome.

dawehner’s picture

Do we then still require the code in the actual argument handler?

damiankloip’s picture

We just have the overriden title_query() method left. Won't we need that for multiples?

dawehner’s picture

Issue tags: -Needs tests, -VDC

#3: 1823398-3.patch queued for re-testing.

Status: Needs review » Needs work

The last submitted patch, 1823398-3.patch, failed testing.

olli’s picture

Component: views.module » user.module
Issue summary: View changes
Status: Needs work » Needs review
Issue tags: +VDC
StatusFileSize
new2.68 KB
new2.7 KB

Reroll.
1. Added test for multiples
2. Removed the anonymous code from argument handler

olli’s picture

StatusFileSize
new4.18 KB
new3.41 KB

Injected the user storage controller.

Is there an issue to add a generic entity id argument handler?

dawehner’s picture

Status: Needs review » Reviewed & tested by the community
+++ b/core/modules/user/lib/Drupal/user/Tests/Views/HandlerArgumentUserUidTest.php
@@ -43,6 +43,17 @@ public function testArgumentTitle() {
+    $anonymous = $this->container->get('config.factory')->get('user.settings')->get('anonymous');

Just in case you have to reroll it again, change that to \Drupal::config()..., as we now not longer call the container like that in tests.

xano’s picture

9: 1823398-9.patch queued for re-testing.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed f22264a and pushed to 8.x. Thanks!

Status: Fixed » Closed (fixed)

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