Loading CHANGELOG.txt +2 −0 Original line number Diff line number Diff line Loading @@ -11,6 +11,8 @@ Metatag 8.x-1.x-dev, xxxx-xx-xx do not have any tokens defined. #3188806 by mortim07, acbramley, DamienMcKenna: Check if the entity being viewed is the route entity. #3188839 by mortim07, DamienMcKenna, mrshowerman, FiNeX, bwaindwain: Node tokens missing. Metatag 8.x-1.15, 2020-12-05 Loading src/Form/MetatagDefaultsForm.php +3 −0 Original line number Diff line number Diff line Loading @@ -117,6 +117,9 @@ class MetatagDefaultsForm extends EntityForm { $token_types = empty($default_type) ? [] : [explode('__', $default_type)[0]]; // Add the token browser at the top. $form += $this->metatagToken->tokenBrowser($token_types); // If this is a new Metatag defaults, then list available bundles. if ($metatag_defaults->isNew()) { $options = $this->getAvailableBundles(); Loading tests/src/FunctionalJavascript/MetatagAvailableTokensTest.php 0 → 100644 +45 −0 Original line number Diff line number Diff line <?php namespace Drupal\Tests\metatag\FunctionalJavascript; use Drupal\Core\Url; use Drupal\FunctionalJavascriptTests\WebDriverTestBase; /** * Tests the available tokens under metatag routes. * * @group metatag */ class MetatagAvailableTokensTest extends WebDriverTestBase { /** * {@inheritdoc} */ public static $modules = ['metatag', 'node']; /** * {@inheritdoc} */ protected $defaultTheme = 'stark'; /** * Test the node metatag defaults page. */ function testNodeMetatagDefaultsPage() { $this->drupalLogin($this->rootUser); $this->drupalGet(Url::fromRoute('entity.metatag_defaults.edit_form', ['metatag_defaults' => 'node'])); $page = $this->getSession()->getPage(); $token_dialog_link = $page->find('css', '.token-dialog'); $token_dialog_link->click(); $this->assertSession()->assertWaitOnAjaxRequest(); $token_dialog = $page->find('css', '.token-tree-dialog'); $token_node_token = $token_dialog->find('css', '#token-node'); $this->assertNotEmpty($token_node_token); } } Loading
CHANGELOG.txt +2 −0 Original line number Diff line number Diff line Loading @@ -11,6 +11,8 @@ Metatag 8.x-1.x-dev, xxxx-xx-xx do not have any tokens defined. #3188806 by mortim07, acbramley, DamienMcKenna: Check if the entity being viewed is the route entity. #3188839 by mortim07, DamienMcKenna, mrshowerman, FiNeX, bwaindwain: Node tokens missing. Metatag 8.x-1.15, 2020-12-05 Loading
src/Form/MetatagDefaultsForm.php +3 −0 Original line number Diff line number Diff line Loading @@ -117,6 +117,9 @@ class MetatagDefaultsForm extends EntityForm { $token_types = empty($default_type) ? [] : [explode('__', $default_type)[0]]; // Add the token browser at the top. $form += $this->metatagToken->tokenBrowser($token_types); // If this is a new Metatag defaults, then list available bundles. if ($metatag_defaults->isNew()) { $options = $this->getAvailableBundles(); Loading
tests/src/FunctionalJavascript/MetatagAvailableTokensTest.php 0 → 100644 +45 −0 Original line number Diff line number Diff line <?php namespace Drupal\Tests\metatag\FunctionalJavascript; use Drupal\Core\Url; use Drupal\FunctionalJavascriptTests\WebDriverTestBase; /** * Tests the available tokens under metatag routes. * * @group metatag */ class MetatagAvailableTokensTest extends WebDriverTestBase { /** * {@inheritdoc} */ public static $modules = ['metatag', 'node']; /** * {@inheritdoc} */ protected $defaultTheme = 'stark'; /** * Test the node metatag defaults page. */ function testNodeMetatagDefaultsPage() { $this->drupalLogin($this->rootUser); $this->drupalGet(Url::fromRoute('entity.metatag_defaults.edit_form', ['metatag_defaults' => 'node'])); $page = $this->getSession()->getPage(); $token_dialog_link = $page->find('css', '.token-dialog'); $token_dialog_link->click(); $this->assertSession()->assertWaitOnAjaxRequest(); $token_dialog = $page->find('css', '.token-tree-dialog'); $token_node_token = $token_dialog->find('css', '#token-node'); $this->assertNotEmpty($token_node_token); } }