Loading CHANGELOG.txt +1 −0 Original line number Diff line number Diff line Loading @@ -13,6 +13,7 @@ Metatag 8.x-1.x-dev, 2022-xx-xx #3303196 by DamienMcKenna: Add extra isSOMETHING() methods to MetaNameBase. #3304779 by luigisa, DamienMcKenna: MetatagManager::processedTokenCache() does not respect the entity language. #3302969 by DamienMcKenna: Refactored MetaNameBase output logic. Metatag 8.x-1.21, 2022-07-16 Loading metatag_extended_perms/tests/src/Functional/PermissionsTest.php +2 −2 Original line number Diff line number Diff line Loading @@ -3,6 +3,7 @@ namespace Drupal\Tests\metatag_extended_perms\Functional; use Drupal\Tests\BrowserTestBase; use Drupal\Tests\metatag\Functional\MetatagHelperTrait; /** * Verify the new permissions are added. Loading @@ -12,7 +13,7 @@ use Drupal\Tests\BrowserTestBase; class PermissionsTest extends BrowserTestBase { // Contains helper methods. use \Drupal\Tests\metatag\Functional\MetatagHelperTrait; use MetatagHelperTrait; /** * {@inheritdoc} Loading Loading @@ -90,7 +91,6 @@ class PermissionsTest extends BrowserTestBase { // Create a content type with a Metatag field. $this->createContentType(); $this->drupalGet('admin/people/permissions'); } /** Loading metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsType.php +19 −9 Original line number Diff line number Diff line Loading @@ -32,15 +32,7 @@ class TwitterCardsType extends MetaNameBase { '#type' => 'select', '#title' => $this->label(), '#description' => $this->description(), '#options' => [ 'summary' => $this->t('Summary Card'), 'summary_large_image' => $this->t('Summary Card with large image'), 'photo' => $this->t('Photo Card'), 'gallery' => $this->t('Gallery Card'), 'app' => $this->t('App Card'), 'player' => $this->t('Player Card'), 'product' => $this->t('Product Card'), ], '#options' => $this->formValues(), '#empty_option' => $this->t('- None -'), '#empty_value' => '', '#default_value' => $this->value(), Loading @@ -51,4 +43,22 @@ class TwitterCardsType extends MetaNameBase { return $form; } /** * The list of select values. * * @return array * A list of values available for this select tag. */ protected function formValues() { return [ 'summary' => $this->t('Summary Card'), 'summary_large_image' => $this->t('Summary Card with large image'), 'photo' => $this->t('Photo Card'), 'gallery' => $this->t('Gallery Card'), 'app' => $this->t('App Card'), 'player' => $this->t('Player Card'), 'product' => $this->t('Product Card'), ]; } } src/Plugin/metatag/Tag/LinkRelBase.php +17 −13 Original line number Diff line number Diff line Loading @@ -8,20 +8,24 @@ namespace Drupal\metatag\Plugin\metatag\Tag; abstract class LinkRelBase extends MetaNameBase { /** * {@inheritdoc} * The string this tag uses for the tag itself. * * @var string */ public function output() { $element = parent::output(); if (!empty($element['#attributes']['content'])) { $element['#tag'] = 'link'; $element['#attributes'] = [ 'rel' => $this->name(), 'href' => $element['#attributes']['content'], ]; unset($element['#attributes']['content']); } protected $htmlTag = 'link'; return $element; } /** * The attribute this tag uses for the name. * * @var string */ protected $htmlNameAttribute = 'rel'; /** * The attribute this tag uses for the contents. * * @var string */ protected $htmlValueAttribute = 'href'; } src/Plugin/metatag/Tag/MetaHttpEquivBase.php +5 −0 Original line number Diff line number Diff line Loading @@ -14,4 +14,9 @@ abstract class MetaHttpEquivBase extends MetaNameBase { */ protected $nameAttribute = 'http-equiv'; /** * {@inheritdoc} */ protected $htmlNameAttribute = 'http-equiv'; } Loading
CHANGELOG.txt +1 −0 Original line number Diff line number Diff line Loading @@ -13,6 +13,7 @@ Metatag 8.x-1.x-dev, 2022-xx-xx #3303196 by DamienMcKenna: Add extra isSOMETHING() methods to MetaNameBase. #3304779 by luigisa, DamienMcKenna: MetatagManager::processedTokenCache() does not respect the entity language. #3302969 by DamienMcKenna: Refactored MetaNameBase output logic. Metatag 8.x-1.21, 2022-07-16 Loading
metatag_extended_perms/tests/src/Functional/PermissionsTest.php +2 −2 Original line number Diff line number Diff line Loading @@ -3,6 +3,7 @@ namespace Drupal\Tests\metatag_extended_perms\Functional; use Drupal\Tests\BrowserTestBase; use Drupal\Tests\metatag\Functional\MetatagHelperTrait; /** * Verify the new permissions are added. Loading @@ -12,7 +13,7 @@ use Drupal\Tests\BrowserTestBase; class PermissionsTest extends BrowserTestBase { // Contains helper methods. use \Drupal\Tests\metatag\Functional\MetatagHelperTrait; use MetatagHelperTrait; /** * {@inheritdoc} Loading Loading @@ -90,7 +91,6 @@ class PermissionsTest extends BrowserTestBase { // Create a content type with a Metatag field. $this->createContentType(); $this->drupalGet('admin/people/permissions'); } /** Loading
metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsType.php +19 −9 Original line number Diff line number Diff line Loading @@ -32,15 +32,7 @@ class TwitterCardsType extends MetaNameBase { '#type' => 'select', '#title' => $this->label(), '#description' => $this->description(), '#options' => [ 'summary' => $this->t('Summary Card'), 'summary_large_image' => $this->t('Summary Card with large image'), 'photo' => $this->t('Photo Card'), 'gallery' => $this->t('Gallery Card'), 'app' => $this->t('App Card'), 'player' => $this->t('Player Card'), 'product' => $this->t('Product Card'), ], '#options' => $this->formValues(), '#empty_option' => $this->t('- None -'), '#empty_value' => '', '#default_value' => $this->value(), Loading @@ -51,4 +43,22 @@ class TwitterCardsType extends MetaNameBase { return $form; } /** * The list of select values. * * @return array * A list of values available for this select tag. */ protected function formValues() { return [ 'summary' => $this->t('Summary Card'), 'summary_large_image' => $this->t('Summary Card with large image'), 'photo' => $this->t('Photo Card'), 'gallery' => $this->t('Gallery Card'), 'app' => $this->t('App Card'), 'player' => $this->t('Player Card'), 'product' => $this->t('Product Card'), ]; } }
src/Plugin/metatag/Tag/LinkRelBase.php +17 −13 Original line number Diff line number Diff line Loading @@ -8,20 +8,24 @@ namespace Drupal\metatag\Plugin\metatag\Tag; abstract class LinkRelBase extends MetaNameBase { /** * {@inheritdoc} * The string this tag uses for the tag itself. * * @var string */ public function output() { $element = parent::output(); if (!empty($element['#attributes']['content'])) { $element['#tag'] = 'link'; $element['#attributes'] = [ 'rel' => $this->name(), 'href' => $element['#attributes']['content'], ]; unset($element['#attributes']['content']); } protected $htmlTag = 'link'; return $element; } /** * The attribute this tag uses for the name. * * @var string */ protected $htmlNameAttribute = 'rel'; /** * The attribute this tag uses for the contents. * * @var string */ protected $htmlValueAttribute = 'href'; }
src/Plugin/metatag/Tag/MetaHttpEquivBase.php +5 −0 Original line number Diff line number Diff line Loading @@ -14,4 +14,9 @@ abstract class MetaHttpEquivBase extends MetaNameBase { */ protected $nameAttribute = 'http-equiv'; /** * {@inheritdoc} */ protected $htmlNameAttribute = 'http-equiv'; }