Verified Commit 2a797ad1 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3433268 by Lendude, smustgrave, longwave, alexpott: Use plugin...

Issue #3433268 by Lendude, smustgrave, longwave, alexpott: Use plugin short_title for admin summary in ViewsArgumentDefault
parent bed3a77a
Loading
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -1392,6 +1392,21 @@ public function getContextDefinition() {
    return $this->getPlugin('argument_validator')->getContextDefinition();
  }

  /**
   * {@inheritdoc}
   */
  public function adminSummary() {
    // If an argument default has been set, show which argument default has been
    // set.
    if ($this->options['default_action'] === 'default') {
      $plugin = $this->getPlugin();
      if ($plugin) {
        return $this->t('Default: @plugin_title', ['@plugin_title' => $plugin->pluginTitle()]);
      }
    }
    return '';
  }

}

/**
+1 −0
Original line number Diff line number Diff line
@@ -73,6 +73,7 @@ public function testArgumentDefaultPlugin() {
    $id = $view->addHandler('default', 'argument', 'views_test_data', 'name', $options);
    $view->initHandlers();
    $plugin = $view->argument[$id]->getPlugin('argument_default');
    $this->assertEquals('Default: Argument default test', $view->argument[$id]->adminSummary());
    $this->assertInstanceOf(ArgumentDefaultTestPlugin::class, $plugin);

    // Check that the value of the default argument is as expected.