Support from Acquia helps fund testing for Drupal Acquia logo

Comments

oadaeh’s picture

I don't want to hold anyone up who may also be working on this, but I have started this, and I will submit a patch later today.

oadaeh’s picture

Issue tags: +VDC

Forgot the tag.

fgm’s picture

Assigned: Unassigned » fgm

Working on it.

Andi-D’s picture

Assigned: fgm » Andi-D

Working on it, because fgm have other things to do.

Andi-D’s picture

Assigned: Andi-D » Unassigned
Status: Active » Needs review
FileSize
6.63 KB

I create a new view

views.view.who_s_new

Fields:

  • User: Name

selected filter:

  • User is active: yes
  • last user access: > 1970-01-01

sort criteria:

  • User Created: Desc

Also delete old block:
UserNewBlock.php

Status: Needs review » Needs work

The last submitted patch, drupal-issue-2020395.patch, failed testing.

oadaeh’s picture

+++ b/core/modules/user/config/views.view.who_s_new.yml
@@ -0,0 +1,165 @@
+    display_title: 'Who`s new'
...
+      block_description: 'Who`s new'
...
+      title: 'Who`s new'
...
+label: 'Who`s new'

The back tics should be apostrophes.

+++ b/core/modules/user/config/views.view.who_s_new.yml
@@ -0,0 +1,165 @@
+      display_description: 'A list off new users'

"of" not "off"

I've attached a patch that corrects those issues.

It seems to apply and work correctly. I'm not sure what's up with the testbot failures.

oadaeh’s picture

Status: Needs work » Needs review

Oi!

oadaeh’s picture

Status: Needs review » Needs work
+++ b/core/modules/user/config/views.view.who_s_new.yml
@@ -0,0 +1,165 @@
+      access:
+        type: perm
+        options:
+          perm: 'access content'

I just noticed this. There should not be any permission checks in the view, because there are no permission checks in the original block settings.

dawehner’s picture

We can now override the items per page, let's get this issue up to speed again.

dawehner’s picture

Status: Needs work » Needs review
FileSize
6.64 KB

I just noticed this. There should not be any permission checks in the view, because there are no permission checks in the original block settings.

I consider this as a bug in the first place. Let's reroll the patch and see what happens.

Status: Needs review » Needs work

The last submitted patch, vdc-2020395-11.patch, failed testing.

dawehner’s picture

Status: Needs work » Needs review
FileSize
831 bytes
7.46 KB

Let's also login a user to show first access.

jibran’s picture

Here is the reroll. I tested the patch it worked fine. I don't know perhaps a usablity review will help. It is ready to fly just one point.

+++ b/core/modules/user/config/views.view.who_s_new.yml
@@ -0,0 +1,165 @@
+          operator: '>'
...
+            value: '1970-01-01'

+++ /dev/null
@@ -1,84 +0,0 @@
-    $uids = db_query_range('SELECT uid FROM {users} WHERE status <> 0 AND access <> 0 ORDER BY created DESC', 0, $this->configuration['whois_new_count'])->fetchCol();

access > 1970-01-01 and access <> 0

old query is
SELECT uid FROM {users} WHERE status <> 0 AND access <> 0 ORDER BY created DESC LIMIT 0, 5
new query is

SELECT users.name AS users_name, users.uid AS uid, users.created AS users_created
FROM 
{users} users
WHERE (( (users.status <> '0') AND (users.access > -18000) ))
ORDER BY users_created DESC
LIMIT 5 OFFSET 0
Bojhan’s picture

No screenshot to review?

dawehner’s picture

Issue tags: +Needs screenshots

Add tag, but well, there should not be a huge change.

oadaeh’s picture

Updated patch.
Also, I filled in the description and the tag.

A screen shot is also attached.

views-whos-new-block.png

jibran’s picture

Issue tags: +Needs screenshots

Please also share the screenshot of block configuration page.

jibran’s picture

Block config page.
img

I have added block category.(Maybe a followup)

Who_s new (User)_sc5e70b8a9e4ef4d.s2.simplytest.me_20130925-111935.png
And It shows up like this

Block layout_sc5e70b8a9e4ef4d.s2.simplytest.me_20130925-112034.png

I just wanted to show it under both categories maybe we can add this feature or we should mention it in field description only on category is allowed. My point is autocomplete made me think it is multi value field.

Here is another issue. (escaping much)

issue.png

NW for changing block category from views to user.

oadaeh’s picture

Twice in the picture you posted, the word category is used, which is singular, not categories, which is plural.

Also, just because a field is auto-complete, does not necessarily mean it takes multiple values. As far as I can remember, whenever I have seen an auto-complete field that accepted multiple values, it was stated so in the description by indicating how to enter multiple values.

mr.baileys’s picture

Assigned: Unassigned » mr.baileys

Assigning to me to try and tackle this as part of the DrupalCon Prague Code Sprint.

mr.baileys’s picture

Status: Needs work » Needs review
FileSize
441 bytes
6.54 KB
99.74 KB

New patch, only change against #17 is the added block category (User):

who_s_new_block_category.jpg

Status: Needs review » Needs work

The last submitted patch, 2020399-35-views-whos-online.patch, failed testing.

mr.baileys’s picture

Status: Needs work » Needs review
FileSize
7.5 KB

Sorry, wrong patch was attached to #22, this should be the correct one. The interdiff in #22 is correct (diff #17 vs this patch).

jibran’s picture

Created #2100959: Views secondary action links escapes html twice for escaping issue mentioned in #19.

oadaeh’s picture

I found a reference to the removed block in user.module.

dawehner’s picture

This does not seem to be a highly critical feature, see http://www.w3.org/TR/wai-aria/roles#complementary though I guess on the longrun we need to add this to either the block UI or just to
the views UI so people can configure it, if needed.

dawehner’s picture

Issue summary: View changes
FileSize
0 bytes

Patch still applies.

dawehner’s picture

Status: Needs review » Reviewed & tested by the community

Let's mark this as RTBC and wait on the feedback of jbeach.

jessebeach’s picture

dawehner brought up in chat a problematic bit of code in the user module:

/**
 * Implements hook_preprocess_HOOK() for block templates.
 */
function user_preprocess_block(&$variables) {
  if ($variables['configuration']['module'] == 'user') {
    switch ($variables['elements']['#plugin_id']) {
      case 'user_login_block':
        $variables['attributes']['role'] = 'form';
        break;
      case 'user_new_block':
        $variables['attributes']['role'] = 'complementary';
        break;
      case 'user_online_block':
        $variables['attributes']['role'] = 'complementary';
        break;
    }
  }
}

So this brings up two issues.

In these three cases, the roles are inappropriate. The complementary role is meant for content that is related to the main content. Blocks displaying data about users have, most likely, nothing to do with the content on the page. And the form role on the log in block should really be on the form element, not that block wrapper. Not having an aria form role on a form element is not terrible.

So, in the interest of getting this issue unblocked, I'm fine with removing this preprocess function and the roles it adds to various user blocks.

I would like to see a way for us to add attributes, and thus role attributes and other aria-* attribtues, to views wrappers so we can mark up content appropriately for accessibility through the GUI. I'll add that issue and link it here.

Xano’s picture

28: vdc-2020395.patch queued for re-testing.

webchick’s picture

I just did a big honkin' review of the sister issue at #2020399-54: Convert "Who's online" block to a View. There's a chance much of it applies here. We'll know in a few minutes! :)

webchick’s picture

Status: Reviewed & tested by the community » Needs work

Oops. No we won't. #26 no longer applies, and #28 is a 0 byte patch.

webchick’s picture

Issue tags: +alpha target

Tagging as an alpha target. Now that #1957276: Let users set the block instance title for Views blocks in the Block UI is in, I think we just need a re-roll and then this one is good to go.

mr.baileys’s picture

Status: Needs work » Needs review
FileSize
8.03 KB

Re-roll

Status: Needs review » Needs work

The last submitted patch, 36: 2020395-36-views-who-s-new.patch, failed testing.

dawehner’s picture

Status: Needs work » Needs review
FileSize
455 bytes
7.88 KB

Thank you for providing the most recent version of the patch.
Let's fix the failure.

jibran’s picture

Status: Needs review » Reviewed & tested by the community

Back to RTBC.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Thanks!

Committed and pushed to 8.x, apart from the category change, per UX guidelines.

alexpott’s picture

Status: Fixed » Needs review

Reverted d2478e9 and pushed to 8.x.

Drupal\views\Tests\DefaultViewsTest and Drupal\comment\Tests\Views\DefaultViewRecentComments

Seems like another patch was committed in the same commit - see http://drupalcode.org/project/drupal.git/commit/f7e75db

alexpott’s picture

38: vdc-2020395.patch queued for re-testing.

Status: Needs review » Needs work

The last submitted patch, 38: vdc-2020395.patch, failed testing.

alexpott’s picture

Status: Needs work » Needs review

38: vdc-2020395.patch queued for re-testing.

dawehner’s picture

FileSize
7.88 KB

Reuploading the last patch.

dawehner’s picture

Status: Needs review » Reviewed & tested by the community

Back to RTBC again.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs reroll

No longer applies :(

dawehner’s picture

Status: Needs work » Needs review
FileSize
7.81 KB

Mh, I should have retested.

Reupload.

dawehner’s picture

Priority: Normal » Major
Status: Needs review » Reviewed & tested by the community

Back to RTBC

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Great work!

Committed and pushed to 8.x. Thanks!

Status: Fixed » Closed (fixed)

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