#1777194: One handler test to rule them all reveiled something nasty.

  // language
  $data['users']['language']['moved to'] = array('users', 'langcode');
  $data['users']['langcode'] = array(
    'title' => t('Language'), // The item it appears as on the UI,
    'help' => t('Language of the user'),
    'field' => array(
      'id' => 'user_language',
      'click sortable' => TRUE,
    ),
    'sort' => array(
      'id' => 'standard',
    ),
    'filter' => array(
      'id' => 'node_language',
    ),
    'argument' => array(
      'id' => 'node_language',
    ),
  );

This piece of code wants to use a node_language argument plugin but it doesn't exist...
Not good ;)

CommentFileSizeAuthor
#9 views-1778768-9.patch3.28 KBdawehner
#5 language-fix.patch339 bytesaspilicious
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dawehner’s picture

dawehner--
dawehner--
dawehner--

The files should be in #1605332: Adapt language integration to d8 but the commit missed the language handler to be committed
Once the files are in there, we can directly use the language handlers there.

aspilicious’s picture

-<?php
-
-/**
- * @file
- * Definition of Views\node\Plugin\views\argument\Language.
- */
-
-namespace Views\node\Plugin\views\argument;
-
-use Drupal\views\Plugin\views\argument\ArgumentPluginBase;
-use Drupal\Core\Annotation\Plugin;
-
-/**
- * Argument handler to accept a language.
- *
- * @Plugin(
- *   id = "node_language",
- *   module = "node"
- * )
- */
-class Language extends ArgumentPluginBase {
-
-  function construct() {
-    parent::construct('language');
-  }
-
-  /**
-   * Override the behavior of summary_name(). Get the user friendly version
-   * of the language.
-   */
-  function summary_name($data) {
-    return $this->node_language($data->{$this->name_alias});
-  }
-
-  /**
-   * Override the behavior of title(). Get the user friendly version of the
-   * node type.
-   */
-  function title() {
-    return $this->node_language($this->argument);
-  }
-
-  function node_language($langcode) {
-    $languages = views_language_list();
-    return isset($languages[$langcode]) ? $languages[$langcode] : t('Unknown language');
-  }
-
-}

We deleted this file...

dawehner’s picture

That's right, but the patch should have added

Views\language\Plugin\views\argument\Language

aspilicious’s picture

Ah but that one is added so we should just point to the correct plugin...

aspilicious’s picture

Status: Active » Needs review
FileSize
339 bytes

See

<?php

/**
 * @file
 * Definition of Views\language\Plugin\views\argument\Language.
 */

namespace Views\language\Plugin\views\argument;

use Drupal\views\Plugin\views\argument\ArgumentPluginBase;
use Drupal\Core\Annotation\Plugin;

/**
 * Argument handler to accept a language.
 *
 * @ingroup views_argument_handlers
 *
 * @Plugin(
 *   id = "language",
 *   module = "language"
 * )
 */
dawehner’s picture

Status: Needs review » Needs work

This

+++ b/modules/user.views.incundefined
@@ -165,7 +165,7 @@ function user_views_data() {
       'id' => 'node_language',
     ),
     'argument' => array(
-      'id' => 'node_language',
+      'id' => 'language',

filter and argument should use language here. If you look at comment.views.inc you will find other instances of that as well, sry

aspilicious’s picture

I assign this to dawhener!

dawehner’s picture

Assigned: Unassigned » dawehner

.

dawehner’s picture

Status: Needs work » Needs review
FileSize
3.28 KB

This fixes comment/user/taxonomy integration.

aspilicious’s picture

Status: Needs review » Reviewed & tested by the community

Good to go!

dawehner’s picture

Status: Reviewed & tested by the community » Fixed

Let's get it in

Status: Fixed » Closed (fixed)

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