From e790d0ac46b0260d94464be96ee4364ed1487bfc Mon Sep 17 00:00:00 2001 From: Brian Canini <canini.16@osu.edu> Date: Wed, 12 Aug 2020 12:34:55 -0400 Subject: [PATCH] Updating drupal/metatag (1.13.0 => 1.14.0) --- composer.json | 2 +- composer.lock | 19 ++-- vendor/composer/installed.json | 19 ++-- web/modules/metatag/CHANGELOG.txt | 24 ++++++ web/modules/metatag/composer.json | 5 +- web/modules/metatag/metatag.info.yml | 6 +- web/modules/metatag/metatag.module | 37 ++++---- .../metatag_app_links.info.yml | 6 +- .../metatag/metatag_dc/metatag_dc.info.yml | 6 +- .../metatag_dc_advanced.info.yml | 6 +- .../metatag_facebook.info.yml | 6 +- .../metatag_favicons.info.yml | 6 +- .../metatag_google_cse.info.yml | 6 +- .../metatag_google_plus.info.yml | 6 +- .../metatag_hreflang.info.yml | 6 +- .../metatag_mobile/metatag_mobile.info.yml | 6 +- .../metatag_open_graph.metatag_tag.schema.yml | 86 ++++++++++++++----- .../metatag_open_graph.info.yml | 6 +- .../src/Plugin/metatag/Tag/OgAudio.php | 24 ++++++ .../Plugin/metatag/Tag/OgAudioSecureUrl.php | 24 ++++++ .../src/Plugin/metatag/Tag/OgAudioType.php | 24 ++++++ .../src/Plugin/metatag/Tag/OgImageWidth.php | 2 +- .../Plugin/metatag/Tag/ProfileFirstName.php | 24 ++++++ .../src/Plugin/metatag/Tag/ProfileGender.php | 24 ++++++ .../Plugin/metatag/Tag/ProfileLastName.php | 24 ++++++ .../Plugin/metatag/Tag/ProfileUsername.php | 24 ++++++ .../src/Plugin/metatag/Tag/VideoActor.php | 24 ++++++ .../src/Plugin/metatag/Tag/VideoActorRole.php | 24 ++++++ .../src/Plugin/metatag/Tag/VideoDirector.php | 24 ++++++ .../Plugin/metatag/Tag/VideoReleaseDate.php | 24 ++++++ .../src/Plugin/metatag/Tag/VideoSeries.php | 24 ++++++ .../src/Plugin/metatag/Tag/VideoTag.php | 24 ++++++ .../src/Plugin/metatag/Tag/VideoWriter.php | 24 ++++++ .../Functional/MetatagOpenGraphTagsTest.php | 18 ++++ .../metatag_open_graph_products.info.yml | 6 +- .../metatag_page_manager.info.yml | 6 +- .../src/Functional/MetatagPageManagerTest.php | 17 ++-- .../metatag_pinterest.info.yml | 6 +- .../metatag_twitter_cards.info.yml | 6 +- .../metatag_verification.info.yml | 6 +- .../metatag_views/metatag_views.info.yml | 6 +- .../src/Form/MetatagViewsTranslationForm.php | 2 +- .../Plugin/GraphQL/Scalars/MetatagScalar.php | 4 +- .../migrate/process/d7/MetatagEntities.php | 28 +++--- .../source/d6/NodewordsFieldInstance.php | 7 ++ .../source/d7/MetatagFieldInstance.php | 7 ++ ...odewords_entities.php => d6_nodewords.php} | 0 ...d7_metatag_entities.php => d7_metatag.php} | 0 .../metatag_test_custom_route.info.yml | 6 +- .../metatag_test_integration.info.yml | 11 +++ .../metatag_test_integration.module | 72 ++++++++++++++++ .../metatag_test_tag.info.yml | 6 +- .../src/Functional/MetatagIntegrationTest.php | 41 +++++++++ .../src/Functional/MetatagPanelizerTest.php | 72 ++++++++++++++++ .../Migrate/d6/NodewordsEntitiesTest.php | 2 +- .../Kernel/Migrate/d7/MetatagEntitiesTest.php | 15 ++-- .../source/d6/NodewordsFieldInstanceTest.php | 3 - .../source/d7/MetatagFieldInstanceTest.php | 3 - 58 files changed, 786 insertions(+), 160 deletions(-) create mode 100644 web/modules/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgAudio.php create mode 100644 web/modules/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgAudioSecureUrl.php create mode 100644 web/modules/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgAudioType.php create mode 100644 web/modules/metatag/metatag_open_graph/src/Plugin/metatag/Tag/ProfileFirstName.php create mode 100644 web/modules/metatag/metatag_open_graph/src/Plugin/metatag/Tag/ProfileGender.php create mode 100644 web/modules/metatag/metatag_open_graph/src/Plugin/metatag/Tag/ProfileLastName.php create mode 100644 web/modules/metatag/metatag_open_graph/src/Plugin/metatag/Tag/ProfileUsername.php create mode 100644 web/modules/metatag/metatag_open_graph/src/Plugin/metatag/Tag/VideoActor.php create mode 100644 web/modules/metatag/metatag_open_graph/src/Plugin/metatag/Tag/VideoActorRole.php create mode 100644 web/modules/metatag/metatag_open_graph/src/Plugin/metatag/Tag/VideoDirector.php create mode 100644 web/modules/metatag/metatag_open_graph/src/Plugin/metatag/Tag/VideoReleaseDate.php create mode 100644 web/modules/metatag/metatag_open_graph/src/Plugin/metatag/Tag/VideoSeries.php create mode 100644 web/modules/metatag/metatag_open_graph/src/Plugin/metatag/Tag/VideoTag.php create mode 100644 web/modules/metatag/metatag_open_graph/src/Plugin/metatag/Tag/VideoWriter.php rename web/modules/metatag/tests/fixtures/{d6_nodewords_entities.php => d6_nodewords.php} (100%) rename web/modules/metatag/tests/fixtures/{d7_metatag_entities.php => d7_metatag.php} (100%) create mode 100644 web/modules/metatag/tests/modules/metatag_test_integration/metatag_test_integration.info.yml create mode 100644 web/modules/metatag/tests/modules/metatag_test_integration/metatag_test_integration.module create mode 100644 web/modules/metatag/tests/src/Functional/MetatagIntegrationTest.php create mode 100644 web/modules/metatag/tests/src/Functional/MetatagPanelizerTest.php diff --git a/composer.json b/composer.json index dcefedb6fb..45274b23af 100644 --- a/composer.json +++ b/composer.json @@ -140,7 +140,7 @@ "drupal/menu_block": "1.6", "drupal/menu_block_title": "1.1", "drupal/menu_breadcrumb": "1.13", - "drupal/metatag": "1.13", + "drupal/metatag": "1.14", "drupal/migrate_devel": "2.0-alpha2", "drupal/migrate_plus": "5.1", "drupal/migrate_tools": "5.0", diff --git a/composer.lock b/composer.lock index a1d683c8cd..2235858e73 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "ddbe24a300d65c01135366f63acfe8fd", + "content-hash": "caf2194a7ee3f3c92e4e9dfb8a1d2311", "packages": [ { "name": "alchemy/zippy", @@ -5987,17 +5987,17 @@ }, { "name": "drupal/metatag", - "version": "1.13.0", + "version": "1.14.0", "source": { "type": "git", "url": "https://git.drupalcode.org/project/metatag.git", - "reference": "8.x-1.13" + "reference": "8.x-1.14" }, "dist": { "type": "zip", - "url": "https://ftp.drupal.org/files/projects/metatag-8.x-1.13.zip", - "reference": "8.x-1.13", - "shasum": "c471d9982a6540fd7baccc94572947923634fb6b" + "url": "https://ftp.drupal.org/files/projects/metatag-8.x-1.14.zip", + "reference": "8.x-1.14", + "shasum": "9bf9f1517ad015d0c93ca1460e284c557624aa90" }, "require": { "drupal/core": "^8 || ^9", @@ -6007,13 +6007,14 @@ "drupal/metatag_dc": "*", "drupal/metatag_open_graph": "*", "drupal/page_manager": "4.x-dev", + "drupal/panelizer": "4.x-dev", "drupal/redirect": "1.x-dev" }, "type": "drupal-module", "extra": { "drupal": { - "version": "8.x-1.13", - "datestamp": "1587478404", + "version": "8.x-1.14", + "datestamp": "1597183852", "security-coverage": { "status": "covered", "message": "Covered by Drupal's security advisory policy" @@ -6022,7 +6023,7 @@ }, "notification-url": "https://packages.drupal.org/8/downloads", "license": [ - "GPL-2.0+" + "GPL-2.0-or-later" ], "authors": [ { diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 79aaa30d67..eed947c093 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -6169,18 +6169,18 @@ }, { "name": "drupal/metatag", - "version": "1.13.0", - "version_normalized": "1.13.0.0", + "version": "1.14.0", + "version_normalized": "1.14.0.0", "source": { "type": "git", "url": "https://git.drupalcode.org/project/metatag.git", - "reference": "8.x-1.13" + "reference": "8.x-1.14" }, "dist": { "type": "zip", - "url": "https://ftp.drupal.org/files/projects/metatag-8.x-1.13.zip", - "reference": "8.x-1.13", - "shasum": "c471d9982a6540fd7baccc94572947923634fb6b" + "url": "https://ftp.drupal.org/files/projects/metatag-8.x-1.14.zip", + "reference": "8.x-1.14", + "shasum": "9bf9f1517ad015d0c93ca1460e284c557624aa90" }, "require": { "drupal/core": "^8 || ^9", @@ -6190,13 +6190,14 @@ "drupal/metatag_dc": "*", "drupal/metatag_open_graph": "*", "drupal/page_manager": "4.x-dev", + "drupal/panelizer": "4.x-dev", "drupal/redirect": "1.x-dev" }, "type": "drupal-module", "extra": { "drupal": { - "version": "8.x-1.13", - "datestamp": "1587478404", + "version": "8.x-1.14", + "datestamp": "1597183852", "security-coverage": { "status": "covered", "message": "Covered by Drupal's security advisory policy" @@ -6206,7 +6207,7 @@ "installation-source": "dist", "notification-url": "https://packages.drupal.org/8/downloads", "license": [ - "GPL-2.0+" + "GPL-2.0-or-later" ], "authors": [ { diff --git a/web/modules/metatag/CHANGELOG.txt b/web/modules/metatag/CHANGELOG.txt index 36e0edbd95..bba6db1911 100644 --- a/web/modules/metatag/CHANGELOG.txt +++ b/web/modules/metatag/CHANGELOG.txt @@ -1,3 +1,27 @@ +Metatag 8.x-1.14, 2020-08-11 +---------------------------- +#3129664 by phenaproxima: Fix failure in MetatagPageManagerTest. +#3154149 by alexpott, DamienMcKenna, mrinalini9, rokzabukovec: Refactored + entity migration test to use new API added in 8.9.x; skip this test on 8.8. +#3154891 by DamienMcKenna: Rename test fixtures to be one file per source + module. +#3129863 by DamienMcKenna, kyuubi, azedan, lcontreras, havran, markie: Revert + compatibility with GraphQL 4 to avoid breaking existing sites. +#3131380 by lolandese, volkswagenchick: License "GPL-2.0+" is a deprecated SPDX + license identifier. +#3130250 by Andrew Gorokhovets: Typo in the comment class name + (MetatagViewsTranslationForm). +#3134665 by Neslee Canil Pinto, rokzabukovec: Correct description of + OgImageWidth.php file. +#3158613 by huzooka, DamienMcKenna, Wim Leers: Metatag field instance migration + source plugins report incorrect number of items. +#3136075 by s_leu, fjgarlin, mirom, DamienMcKenna: D9 Compatibility - + pre_render should be method implementing TrustedCallbackInterface. +#3153911 by alexpott, mrinalini9: Improve logic in metatag_page_attachments() + and make code comments more clear. +#3077782 by DamienMcKenna, rokzabukovec, rahulrasgon: Add missing OG tags. + + Metatag 8.x-1.13, 2020-04-21 ---------------------------- #3123520 by DamienMcKenna, phenaproxima: Remove Schema.org Metatag dependency diff --git a/web/modules/metatag/composer.json b/web/modules/metatag/composer.json index 3bfe025649..88b6bbd6fb 100644 --- a/web/modules/metatag/composer.json +++ b/web/modules/metatag/composer.json @@ -2,7 +2,7 @@ "name": "drupal/metatag", "description": "Manage meta tags for all entities.", "type": "drupal-module", - "license": "GPL-2.0+", + "license": "GPL-2.0-or-later", "keywords": [ "Drupal", "seo" @@ -27,6 +27,7 @@ }, "require-dev": { "drupal/redirect": "1.x-dev", - "drupal/page_manager": "4.x-dev" + "drupal/page_manager": "4.x-dev", + "drupal/panelizer": "4.x-dev" } } diff --git a/web/modules/metatag/metatag.info.yml b/web/modules/metatag/metatag.info.yml index 3106a7446d..24672a84a3 100644 --- a/web/modules/metatag/metatag.info.yml +++ b/web/modules/metatag/metatag.info.yml @@ -8,7 +8,7 @@ dependencies: - drupal:field - token:token -# Information added by Drupal.org packaging script on 2020-04-21 -version: '8.x-1.13' +# Information added by Drupal.org packaging script on 2020-08-11 +version: '8.x-1.14' project: 'metatag' -datestamp: 1587476386 +datestamp: 1597183854 diff --git a/web/modules/metatag/metatag.module b/web/modules/metatag/metatag.module index 3f5b2bed76..abd3e64373 100644 --- a/web/modules/metatag/metatag.module +++ b/web/modules/metatag/metatag.module @@ -144,6 +144,13 @@ function metatag_page_attachments(array &$attachments) { $head_links = []; foreach ($metatag_attachments['#attached']['html_head'] as $item) { + // Do not attach a title meta tag as this unnecessarily duplicates the + // title tag. + // @see metatag_preprocess_html() + if ($item[1] == 'title') { + continue; + } + $attachments['#attached']['html_head'][] = $item; // Also add a HTTP header "Link:" for canonical URLs and shortlinks. @@ -170,18 +177,6 @@ function metatag_page_attachments(array &$attachments) { ]; } } - - // Remove the erroneous "title" meta tag as the page title has already been - // overridden. - // @see metatag_preprocess_html() - if (!empty($attachments['#attached']['html_head'])) { - foreach ($attachments['#attached']['html_head'] as $ctr => $data) { - if (!empty($data[1]) && $data[1] == 'title') { - unset($attachments['#attached']['html_head'][$ctr]); - break; - } - } - } } /** @@ -230,7 +225,9 @@ function metatag_entity_view_alter(array &$build, EntityInterface $entity, Entit // called too early, where meta links are not yet set. // @see \Drupal\node\Controller\NodeController::view if ($display->getThirdPartySetting('panelizer', 'enable', FALSE)) { - $build['#pre_render'][] = '_metatag_panelizer_pre_render'; + $build['#pre_render'][] = function (array $element) { + return _metatag_panelizer_pre_render($element); + }; return; } @@ -425,20 +422,20 @@ function metatag_preprocess_html(&$variables) { return NULL; } - $attachments = &drupal_static('metatag_attachments'); - if (is_null($attachments)) { - $attachments = metatag_get_tags_from_route(); + $metatag_attachments = &drupal_static('metatag_attachments'); + if (is_null($metatag_attachments)) { + $metatag_attachments = metatag_get_tags_from_route(); } - if (!$attachments) { + if (!$metatag_attachments) { return NULL; } // Copy the "title" meta tag into the regular <title> tag. The redundant meta - // tag will be removed elsewhere. + // tag is never added to $variables['#attached']. // @see metatag_page_attachments() - if (!empty($attachments['#attached']['html_head'])) { - foreach ($attachments['#attached']['html_head'] as $attachment) { + if (!empty($metatag_attachments['#attached']['html_head'])) { + foreach ($metatag_attachments['#attached']['html_head'] as $attachment) { if (!empty($attachment[1]) && $attachment[1] == 'title') { // Empty head_title to avoid the site name and slogan to be appended to // the meta title. diff --git a/web/modules/metatag/metatag_app_links/metatag_app_links.info.yml b/web/modules/metatag/metatag_app_links/metatag_app_links.info.yml index 1a650e61f6..492e7aa835 100644 --- a/web/modules/metatag/metatag_app_links/metatag_app_links.info.yml +++ b/web/modules/metatag/metatag_app_links/metatag_app_links.info.yml @@ -6,7 +6,7 @@ package: SEO dependencies: - metatag:metatag -# Information added by Drupal.org packaging script on 2020-04-21 -version: '8.x-1.13' +# Information added by Drupal.org packaging script on 2020-08-11 +version: '8.x-1.14' project: 'metatag' -datestamp: 1587476386 +datestamp: 1597183854 diff --git a/web/modules/metatag/metatag_dc/metatag_dc.info.yml b/web/modules/metatag/metatag_dc/metatag_dc.info.yml index 75da63357c..8aab6e84e8 100644 --- a/web/modules/metatag/metatag_dc/metatag_dc.info.yml +++ b/web/modules/metatag/metatag_dc/metatag_dc.info.yml @@ -6,7 +6,7 @@ package: SEO dependencies: - metatag:metatag -# Information added by Drupal.org packaging script on 2020-04-21 -version: '8.x-1.13' +# Information added by Drupal.org packaging script on 2020-08-11 +version: '8.x-1.14' project: 'metatag' -datestamp: 1587476386 +datestamp: 1597183854 diff --git a/web/modules/metatag/metatag_dc_advanced/metatag_dc_advanced.info.yml b/web/modules/metatag/metatag_dc_advanced/metatag_dc_advanced.info.yml index c56067b54d..9c2285ee22 100644 --- a/web/modules/metatag/metatag_dc_advanced/metatag_dc_advanced.info.yml +++ b/web/modules/metatag/metatag_dc_advanced/metatag_dc_advanced.info.yml @@ -7,7 +7,7 @@ dependencies: - metatag:metatag - metatag:metatag_dc -# Information added by Drupal.org packaging script on 2020-04-21 -version: '8.x-1.13' +# Information added by Drupal.org packaging script on 2020-08-11 +version: '8.x-1.14' project: 'metatag' -datestamp: 1587476386 +datestamp: 1597183854 diff --git a/web/modules/metatag/metatag_facebook/metatag_facebook.info.yml b/web/modules/metatag/metatag_facebook/metatag_facebook.info.yml index f9bdef89b5..0801c69f27 100644 --- a/web/modules/metatag/metatag_facebook/metatag_facebook.info.yml +++ b/web/modules/metatag/metatag_facebook/metatag_facebook.info.yml @@ -6,7 +6,7 @@ package: SEO dependencies: - metatag:metatag -# Information added by Drupal.org packaging script on 2020-04-21 -version: '8.x-1.13' +# Information added by Drupal.org packaging script on 2020-08-11 +version: '8.x-1.14' project: 'metatag' -datestamp: 1587476386 +datestamp: 1597183854 diff --git a/web/modules/metatag/metatag_favicons/metatag_favicons.info.yml b/web/modules/metatag/metatag_favicons/metatag_favicons.info.yml index d70e4fff50..42e308d5a7 100644 --- a/web/modules/metatag/metatag_favicons/metatag_favicons.info.yml +++ b/web/modules/metatag/metatag_favicons/metatag_favicons.info.yml @@ -6,7 +6,7 @@ package: SEO dependencies: - metatag:metatag -# Information added by Drupal.org packaging script on 2020-04-21 -version: '8.x-1.13' +# Information added by Drupal.org packaging script on 2020-08-11 +version: '8.x-1.14' project: 'metatag' -datestamp: 1587476386 +datestamp: 1597183854 diff --git a/web/modules/metatag/metatag_google_cse/metatag_google_cse.info.yml b/web/modules/metatag/metatag_google_cse/metatag_google_cse.info.yml index 3702bb8ee6..aafc3a5eae 100644 --- a/web/modules/metatag/metatag_google_cse/metatag_google_cse.info.yml +++ b/web/modules/metatag/metatag_google_cse/metatag_google_cse.info.yml @@ -6,7 +6,7 @@ package: SEO dependencies: - metatag:metatag -# Information added by Drupal.org packaging script on 2020-04-21 -version: '8.x-1.13' +# Information added by Drupal.org packaging script on 2020-08-11 +version: '8.x-1.14' project: 'metatag' -datestamp: 1587476386 +datestamp: 1597183854 diff --git a/web/modules/metatag/metatag_google_plus/metatag_google_plus.info.yml b/web/modules/metatag/metatag_google_plus/metatag_google_plus.info.yml index 2f86cb2d22..cab2f5568d 100644 --- a/web/modules/metatag/metatag_google_plus/metatag_google_plus.info.yml +++ b/web/modules/metatag/metatag_google_plus/metatag_google_plus.info.yml @@ -6,7 +6,7 @@ package: SEO dependencies: - metatag:metatag -# Information added by Drupal.org packaging script on 2020-04-21 -version: '8.x-1.13' +# Information added by Drupal.org packaging script on 2020-08-11 +version: '8.x-1.14' project: 'metatag' -datestamp: 1587476386 +datestamp: 1597183854 diff --git a/web/modules/metatag/metatag_hreflang/metatag_hreflang.info.yml b/web/modules/metatag/metatag_hreflang/metatag_hreflang.info.yml index 4404b337ca..9cd5956a7b 100644 --- a/web/modules/metatag/metatag_hreflang/metatag_hreflang.info.yml +++ b/web/modules/metatag/metatag_hreflang/metatag_hreflang.info.yml @@ -6,7 +6,7 @@ package: SEO dependencies: - metatag:metatag -# Information added by Drupal.org packaging script on 2020-04-21 -version: '8.x-1.13' +# Information added by Drupal.org packaging script on 2020-08-11 +version: '8.x-1.14' project: 'metatag' -datestamp: 1587476386 +datestamp: 1597183854 diff --git a/web/modules/metatag/metatag_mobile/metatag_mobile.info.yml b/web/modules/metatag/metatag_mobile/metatag_mobile.info.yml index 4fd20ab3f9..03ef7dd583 100644 --- a/web/modules/metatag/metatag_mobile/metatag_mobile.info.yml +++ b/web/modules/metatag/metatag_mobile/metatag_mobile.info.yml @@ -6,7 +6,7 @@ package: SEO dependencies: - metatag:metatag -# Information added by Drupal.org packaging script on 2020-04-21 -version: '8.x-1.13' +# Information added by Drupal.org packaging script on 2020-08-11 +version: '8.x-1.14' project: 'metatag' -datestamp: 1587476386 +datestamp: 1597183854 diff --git a/web/modules/metatag/metatag_open_graph/config/schema/metatag_open_graph.metatag_tag.schema.yml b/web/modules/metatag/metatag_open_graph/config/schema/metatag_open_graph.metatag_tag.schema.yml index 2fbec0b63b..68bdff47f9 100644 --- a/web/modules/metatag/metatag_open_graph/config/schema/metatag_open_graph.metatag_tag.schema.yml +++ b/web/modules/metatag/metatag_open_graph/config/schema/metatag_open_graph.metatag_tag.schema.yml @@ -2,6 +2,48 @@ # could get longer, especially ones which use a textarea field instead of a # textfield. +metatag.metatag_tag.article_author: + type: label + label: 'Article author' +metatag.metatag_tag.article_expiration_time: + type: label + label: 'Article expiration time' +metatag.metatag_tag.article_modified_time: + type: label + label: 'Article modified time' +metatag.metatag_tag.article_published_time: + type: label + label: 'Article published time' +metatag.metatag_tag.article_publisher: + type: label + label: 'Article publisher' +metatag.metatag_tag.article_section: + type: label + label: 'Article section' +metatag.metatag_tag.article_tag: + type: label + label: 'Article tag(s)' +metatag.metatag_tag.book_author: + type: label + label: 'Book Author' +metatag.metatag_tag.book_isbn: + type: label + label: 'Book ISBN' +metatag.metatag_tag.book_release_date: + type: label + label: 'Book Release Date' +metatag.metatag_tag.book_tag: + type: label + label: 'Book Tags' +metatag.metatag_tag.og_audio: + type: label + label: 'Audio URL' +metatag.metatag_tag.og_audio_secure_url: + type: label + label: 'Audio secure URL' +metatag.metatag_tag.og_audio_type: + type: label + label: 'Audio type' metatag.metatag_tag.og_country_name: type: label label: 'Open Graph: Country name' @@ -101,36 +143,36 @@ metatag.metatag_tag.og_video_type: metatag.metatag_tag.og_video_width: type: label label: 'Open Graph: Video width' -metatag.metatag_tag.article_author: +metatag.metatag_tag.profile_first_name: type: label - label: 'Article author' -metatag.metatag_tag.article_expiration_time: + label: 'First name' +metatag.metatag_tag.profile_gender: type: label - label: 'Article expiration time' -metatag.metatag_tag.article_modified_time: + label: 'Gender' +metatag.metatag_tag.profile_last_name: type: label - label: 'Article modified time' -metatag.metatag_tag.article_published_time: + label: 'Last name' +metatag.metatag_tag.profile_username: type: label - label: 'Article published time' -metatag.metatag_tag.article_publisher: + label: 'Username' +metatag.metatag_tag.video_actor: type: label - label: 'Article publisher' -metatag.metatag_tag.article_section: + label: 'Actor(s)' +metatag.metatag_tag.video_actor_role: type: label - label: 'Article section' -metatag.metatag_tag.article_tag: + label: "Actor's role" +metatag.metatag_tag.video_director: type: label - label: 'Article tag(s)' -metatag.metatag_tag.book_author: + label: 'Director(s)' +metatag.metatag_tag.video_release_date: type: label - label: 'Book Author' -metatag.metatag_tag.book_isbn: + label: 'Release date' +metatag.metatag_tag.video_series: type: label - label: 'Book ISBN' -metatag.metatag_tag.book_release_date: + label: 'Series' +metatag.metatag_tag.video_tag: type: label - label: 'Book Release Date' -metatag.metatag_tag.book_tag: + label: 'Tag words' +metatag.metatag_tag.video_writer: type: label - label: 'Book Tags' + label: 'Scriptwriter(s)' diff --git a/web/modules/metatag/metatag_open_graph/metatag_open_graph.info.yml b/web/modules/metatag/metatag_open_graph/metatag_open_graph.info.yml index 3a62734af8..a083a86882 100644 --- a/web/modules/metatag/metatag_open_graph/metatag_open_graph.info.yml +++ b/web/modules/metatag/metatag_open_graph/metatag_open_graph.info.yml @@ -6,7 +6,7 @@ package: SEO dependencies: - metatag:metatag -# Information added by Drupal.org packaging script on 2020-04-21 -version: '8.x-1.13' +# Information added by Drupal.org packaging script on 2020-08-11 +version: '8.x-1.14' project: 'metatag' -datestamp: 1587476386 +datestamp: 1597183854 diff --git a/web/modules/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgAudio.php b/web/modules/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgAudio.php new file mode 100644 index 0000000000..577961a65c --- /dev/null +++ b/web/modules/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgAudio.php @@ -0,0 +1,24 @@ +<?php + +namespace Drupal\metatag_open_graph\Plugin\metatag\Tag; + +use Drupal\metatag\Plugin\metatag\Tag\MetaPropertyBase; + +/** + * Provides a plugin for the 'og:audio' meta tag. + * + * @MetatagTag( + * id = "og_audio", + * label = @Translation("Audio URL"), + * description = @Translation("The URL to an audio file that complements this object."), + * name = "og:audio", + * group = "open_graph", + * weight = 39, + * type = "uri", + * secure = FALSE, + * multiple = FALSE + * ) + */ +class OgAudio extends MetaPropertyBase { + // Nothing here yet. Just a placeholder class for a plugin. +} diff --git a/web/modules/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgAudioSecureUrl.php b/web/modules/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgAudioSecureUrl.php new file mode 100644 index 0000000000..cbed7418b9 --- /dev/null +++ b/web/modules/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgAudioSecureUrl.php @@ -0,0 +1,24 @@ +<?php + +namespace Drupal\metatag_open_graph\Plugin\metatag\Tag; + +use Drupal\metatag\Plugin\metatag\Tag\MetaPropertyBase; + +/** + * Provides a plugin for the 'og:audio:secure_url' meta tag. + * + * @MetatagTag( + * id = "og_audio_secure_url", + * label = @Translation("Audio secure URL"), + * description = @Translation("The secure URL to an audio file that complements this object. All 'http://' URLs will automatically be converted to 'https://'."), + * name = "og:audio:secure_url", + * group = "open_graph", + * weight = 40, + * type = "uri", + * secure = TRUE, + * multiple = FALSE + * ) + */ +class OgAudioSecureUrl extends MetaPropertyBase { + // Nothing here yet. Just a placeholder class for a plugin. +} diff --git a/web/modules/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgAudioType.php b/web/modules/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgAudioType.php new file mode 100644 index 0000000000..8612dd18ca --- /dev/null +++ b/web/modules/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgAudioType.php @@ -0,0 +1,24 @@ +<?php + +namespace Drupal\metatag_open_graph\Plugin\metatag\Tag; + +use Drupal\metatag\Plugin\metatag\Tag\MetaPropertyBase; + +/** + * Provides a plugin for the 'og:audio:type' meta tag. + * + * @MetatagTag( + * id = "og_audio_type", + * label = @Translation("Audio type"), + * description = @Translation("The MIME type of the audio file. Examples include 'application/mp3' for an MP3 file."), + * name = "og:audio:type", + * group = "open_graph", + * weight = 41, + * type = "string", + * secure = FALSE, + * multiple = FALSE + * ) + */ +class OgAudioType extends MetaPropertyBase { + // Nothing here yet. Just a placeholder class for a plugin. +} diff --git a/web/modules/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgImageWidth.php b/web/modules/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgImageWidth.php index 539341bdd1..fa8821c3fc 100644 --- a/web/modules/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgImageWidth.php +++ b/web/modules/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgImageWidth.php @@ -10,7 +10,7 @@ * @MetatagTag( * id = "og_image_width", * label = @Translation("Image width"), - * description = @Translation("The height of the above image(s). Note: if both the unsecured and secured images are provided, they should both be the same size."), + * description = @Translation("The width of the above image(s). Note: if both the unsecured and secured images are provided, they should both be the same size."), * name = "og:image:width", * group = "open_graph", * weight = 13, diff --git a/web/modules/metatag/metatag_open_graph/src/Plugin/metatag/Tag/ProfileFirstName.php b/web/modules/metatag/metatag_open_graph/src/Plugin/metatag/Tag/ProfileFirstName.php new file mode 100644 index 0000000000..6fd740f2c5 --- /dev/null +++ b/web/modules/metatag/metatag_open_graph/src/Plugin/metatag/Tag/ProfileFirstName.php @@ -0,0 +1,24 @@ +<?php + +namespace Drupal\metatag_open_graph\Plugin\metatag\Tag; + +use Drupal\metatag\Plugin\metatag\Tag\MetaPropertyBase; + +/** + * Provides a plugin for the 'profile:first_name' meta tag. + * + * @MetatagTag( + * id = "profile_first_name", + * label = @Translation("First name"), + * description = @Translation("The first name of the person who's Profile page this is."), + * name = "profile:first_name", + * group = "open_graph", + * weight = 42, + * type = "string", + * secure = FALSE, + * multiple = FALSE + * ) + */ +class ProfileFirstName extends MetaPropertyBase { + // Nothing here yet. Just a placeholder class for a plugin. +} diff --git a/web/modules/metatag/metatag_open_graph/src/Plugin/metatag/Tag/ProfileGender.php b/web/modules/metatag/metatag_open_graph/src/Plugin/metatag/Tag/ProfileGender.php new file mode 100644 index 0000000000..fbe7792768 --- /dev/null +++ b/web/modules/metatag/metatag_open_graph/src/Plugin/metatag/Tag/ProfileGender.php @@ -0,0 +1,24 @@ +<?php + +namespace Drupal\metatag_open_graph\Plugin\metatag\Tag; + +use Drupal\metatag\Plugin\metatag\Tag\MetaPropertyBase; + +/** + * Provides a plugin for the 'profile:gender' meta tag. + * + * @MetatagTag( + * id = "profile_gender", + * label = @Translation("Gender"), + * description = @Translation("Any of Facebook's gender values should be allowed, the initial two being 'male' and 'female'."), + * name = "profile:gender", + * group = "open_graph", + * weight = 44, + * type = "string", + * secure = FALSE, + * multiple = FALSE + * ) + */ +class ProfileGender extends MetaPropertyBase { + // Nothing here yet. Just a placeholder class for a plugin. +} diff --git a/web/modules/metatag/metatag_open_graph/src/Plugin/metatag/Tag/ProfileLastName.php b/web/modules/metatag/metatag_open_graph/src/Plugin/metatag/Tag/ProfileLastName.php new file mode 100644 index 0000000000..c54e04ed93 --- /dev/null +++ b/web/modules/metatag/metatag_open_graph/src/Plugin/metatag/Tag/ProfileLastName.php @@ -0,0 +1,24 @@ +<?php + +namespace Drupal\metatag_open_graph\Plugin\metatag\Tag; + +use Drupal\metatag\Plugin\metatag\Tag\MetaPropertyBase; + +/** + * Provides a plugin for the 'profile:last_name' meta tag. + * + * @MetatagTag( + * id = "profile_last_name", + * label = @Translation("Last name"), + * description = @Translation("The person's last name."), + * name = "profile:last_name", + * group = "open_graph", + * weight = 43, + * type = "string", + * secure = FALSE, + * multiple = FALSE + * ) + */ +class ProfileLastName extends MetaPropertyBase { + // Nothing here yet. Just a placeholder class for a plugin. +} diff --git a/web/modules/metatag/metatag_open_graph/src/Plugin/metatag/Tag/ProfileUsername.php b/web/modules/metatag/metatag_open_graph/src/Plugin/metatag/Tag/ProfileUsername.php new file mode 100644 index 0000000000..465e11d489 --- /dev/null +++ b/web/modules/metatag/metatag_open_graph/src/Plugin/metatag/Tag/ProfileUsername.php @@ -0,0 +1,24 @@ +<?php + +namespace Drupal\metatag_open_graph\Plugin\metatag\Tag; + +use Drupal\metatag\Plugin\metatag\Tag\MetaPropertyBase; + +/** + * Provides a plugin for the 'profile:username' meta tag. + * + * @MetatagTag( + * id = "profile_username", + * label = @Translation("Username"), + * description = @Translation("A pseudonym / alias of this person."), + * name = "profile:username", + * group = "open_graph", + * weight = 45, + * type = "string", + * secure = FALSE, + * multiple = FALSE + * ) + */ +class ProfileUsername extends MetaPropertyBase { + // Nothing here yet. Just a placeholder class for a plugin. +} diff --git a/web/modules/metatag/metatag_open_graph/src/Plugin/metatag/Tag/VideoActor.php b/web/modules/metatag/metatag_open_graph/src/Plugin/metatag/Tag/VideoActor.php new file mode 100644 index 0000000000..eb48324db0 --- /dev/null +++ b/web/modules/metatag/metatag_open_graph/src/Plugin/metatag/Tag/VideoActor.php @@ -0,0 +1,24 @@ +<?php + +namespace Drupal\metatag_open_graph\Plugin\metatag\Tag; + +use Drupal\metatag\Plugin\metatag\Tag\MetaPropertyBase; + +/** + * Provides a plugin for the 'video:actor' meta tag. + * + * @MetatagTag( + * id = "video_actor", + * label = @Translation("Actor(s)"), + * description = @Translation("Links to the Facebook profiles for actor(s) that appear in the video."), + * name = "video:actor", + * group = "open_graph", + * weight = 45, + * type = "uri", + * secure = FALSE, + * multiple = TRUE + * ) + */ +class VideoActor extends MetaPropertyBase { + // Nothing here yet. Just a placeholder class for a plugin. +} diff --git a/web/modules/metatag/metatag_open_graph/src/Plugin/metatag/Tag/VideoActorRole.php b/web/modules/metatag/metatag_open_graph/src/Plugin/metatag/Tag/VideoActorRole.php new file mode 100644 index 0000000000..7146d48e06 --- /dev/null +++ b/web/modules/metatag/metatag_open_graph/src/Plugin/metatag/Tag/VideoActorRole.php @@ -0,0 +1,24 @@ +<?php + +namespace Drupal\metatag_open_graph\Plugin\metatag\Tag; + +use Drupal\metatag\Plugin\metatag\Tag\MetaPropertyBase; + +/** + * Provides a plugin for the 'video:actor:role' meta tag. + * + * @MetatagTag( + * id = "video_actor_role", + * label = @Translation("Actor's role"), + * description = @Translation("The roles of the actor(s)."), + * name = "video:actor:role", + * group = "open_graph", + * weight = 46, + * type = "string", + * secure = FALSE, + * multiple = TRUE + * ) + */ +class VideoActorRole extends MetaPropertyBase { + // Nothing here yet. Just a placeholder class for a plugin. +} diff --git a/web/modules/metatag/metatag_open_graph/src/Plugin/metatag/Tag/VideoDirector.php b/web/modules/metatag/metatag_open_graph/src/Plugin/metatag/Tag/VideoDirector.php new file mode 100644 index 0000000000..149643e567 --- /dev/null +++ b/web/modules/metatag/metatag_open_graph/src/Plugin/metatag/Tag/VideoDirector.php @@ -0,0 +1,24 @@ +<?php + +namespace Drupal\metatag_open_graph\Plugin\metatag\Tag; + +use Drupal\metatag\Plugin\metatag\Tag\MetaPropertyBase; + +/** + * Provides a plugin for the 'video:director' meta tag. + * + * @MetatagTag( + * id = "video_director", + * label = @Translation("Director(s)"), + * description = @Translation("Links to the Facebook profiles for director(s) that worked on the video."), + * name = "video:director", + * group = "open_graph", + * weight = 47, + * type = "uri", + * secure = FALSE, + * multiple = TRUE + * ) + */ +class VideoDirector extends MetaPropertyBase { + // Nothing here yet. Just a placeholder class for a plugin. +} diff --git a/web/modules/metatag/metatag_open_graph/src/Plugin/metatag/Tag/VideoReleaseDate.php b/web/modules/metatag/metatag_open_graph/src/Plugin/metatag/Tag/VideoReleaseDate.php new file mode 100644 index 0000000000..2bccdd5514 --- /dev/null +++ b/web/modules/metatag/metatag_open_graph/src/Plugin/metatag/Tag/VideoReleaseDate.php @@ -0,0 +1,24 @@ +<?php + +namespace Drupal\metatag_open_graph\Plugin\metatag\Tag; + +use Drupal\metatag\Plugin\metatag\Tag\MetaPropertyBase; + +/** + * Provides a plugin for the 'video:release_date' meta tag. + * + * @MetatagTag( + * id = "video_release_date", + * label = @Translation("Release date"), + * description = @Translation("The date the video was released."), + * name = "video:release_date", + * group = "open_graph", + * weight = 48, + * type = "date", + * secure = FALSE, + * multiple = FALSE + * ) + */ +class VideoReleaseDate extends MetaPropertyBase { + // Nothing here yet. Just a placeholder class for a plugin. +} diff --git a/web/modules/metatag/metatag_open_graph/src/Plugin/metatag/Tag/VideoSeries.php b/web/modules/metatag/metatag_open_graph/src/Plugin/metatag/Tag/VideoSeries.php new file mode 100644 index 0000000000..efdd34adc0 --- /dev/null +++ b/web/modules/metatag/metatag_open_graph/src/Plugin/metatag/Tag/VideoSeries.php @@ -0,0 +1,24 @@ +<?php + +namespace Drupal\metatag_open_graph\Plugin\metatag\Tag; + +use Drupal\metatag\Plugin\metatag\Tag\MetaPropertyBase; + +/** + * Provides a plugin for the 'video:series' meta tag. + * + * @MetatagTag( + * id = "video_series", + * label = @Translation("Series"), + * description = @Translation("The TV show this series belongs to."), + * name = "video:series", + * group = "open_graph", + * weight = 48, + * type = "string", + * secure = FALSE, + * multiple = FALSE + * ) + */ +class VideoSeries extends MetaPropertyBase { + // Nothing here yet. Just a placeholder class for a plugin. +} diff --git a/web/modules/metatag/metatag_open_graph/src/Plugin/metatag/Tag/VideoTag.php b/web/modules/metatag/metatag_open_graph/src/Plugin/metatag/Tag/VideoTag.php new file mode 100644 index 0000000000..fee560187e --- /dev/null +++ b/web/modules/metatag/metatag_open_graph/src/Plugin/metatag/Tag/VideoTag.php @@ -0,0 +1,24 @@ +<?php + +namespace Drupal\metatag_open_graph\Plugin\metatag\Tag; + +use Drupal\metatag\Plugin\metatag\Tag\MetaPropertyBase; + +/** + * Provides a plugin for the 'video:tag' meta tag. + * + * @MetatagTag( + * id = "video_tag", + * label = @Translation("Tag words"), + * description = @Translation("Tag words associated with this video."), + * name = "video:tag", + * group = "open_graph", + * weight = 49, + * type = "string", + * secure = FALSE, + * multiple = TRUE + * ) + */ +class VideoTag extends MetaPropertyBase { + // Nothing here yet. Just a placeholder class for a plugin. +} diff --git a/web/modules/metatag/metatag_open_graph/src/Plugin/metatag/Tag/VideoWriter.php b/web/modules/metatag/metatag_open_graph/src/Plugin/metatag/Tag/VideoWriter.php new file mode 100644 index 0000000000..fa02192298 --- /dev/null +++ b/web/modules/metatag/metatag_open_graph/src/Plugin/metatag/Tag/VideoWriter.php @@ -0,0 +1,24 @@ +<?php + +namespace Drupal\metatag_open_graph\Plugin\metatag\Tag; + +use Drupal\metatag\Plugin\metatag\Tag\MetaPropertyBase; + +/** + * Provides a plugin for the 'video:writer' meta tag. + * + * @MetatagTag( + * id = "video_writer", + * label = @Translation("Scriptwriter(s)"), + * description = @Translation("Links to the Facebook profiles for scriptwriter(s) for the video."), + * name = "video:writer", + * group = "open_graph", + * weight = 50, + * type = "uri", + * secure = FALSE, + * multiple = TRUE + * ) + */ +class VideoWriter extends MetaPropertyBase { + // Nothing here yet. Just a placeholder class for a plugin. +} diff --git a/web/modules/metatag/metatag_open_graph/tests/src/Functional/MetatagOpenGraphTagsTest.php b/web/modules/metatag/metatag_open_graph/tests/src/Functional/MetatagOpenGraphTagsTest.php index 3b5c6f3339..b2346f74c8 100644 --- a/web/modules/metatag/metatag_open_graph/tests/src/Functional/MetatagOpenGraphTagsTest.php +++ b/web/modules/metatag/metatag_open_graph/tests/src/Functional/MetatagOpenGraphTagsTest.php @@ -26,6 +26,9 @@ class MetatagOpenGraphTagsTest extends MetatagTagsTestBase { 'book_isbn', 'book_release_date', 'book_tag', + 'og_audio', + 'og_audio_secure_url', + 'og_audio_type', 'og_country_name', 'og_description', 'og_determiner', @@ -53,6 +56,17 @@ class MetatagOpenGraphTagsTest extends MetatagTagsTestBase { 'og_video_type', 'og_video_width', 'og_video_duration', + 'profile_first_name', + 'profile_gender', + 'profile_last_name', + 'profile_username', + 'video_actor', + 'video_actor_role', + 'video_director', + 'video_release_date', + 'video_series', + 'video_tag', + 'video_writer', // @todo Fix these. // 'og_image', // 'og_image_secure_url', @@ -88,10 +102,14 @@ protected function getTestTagName($tag_name) { $tag_name = str_replace('og_', 'og:', $tag_name); $tag_name = str_replace('article_', 'article:', $tag_name); $tag_name = str_replace('book_', 'book:', $tag_name); + $tag_name = str_replace('profile_', 'profile:', $tag_name); + $tag_name = str_replace('video_', 'video:', $tag_name); // Some tags have an additional underline that turns into a colon. + $tag_name = str_replace('og:audio_', 'og:audio:', $tag_name); $tag_name = str_replace('og:image_', 'og:image:', $tag_name); $tag_name = str_replace('og:video_', 'og:video:', $tag_name); + $tag_name = str_replace('video:actor_', 'video:actor:', $tag_name); // Additional fixes. if ($tag_name == 'og:locale_alternative') { diff --git a/web/modules/metatag/metatag_open_graph_products/metatag_open_graph_products.info.yml b/web/modules/metatag/metatag_open_graph_products/metatag_open_graph_products.info.yml index 6b7195301f..b3420183c6 100644 --- a/web/modules/metatag/metatag_open_graph_products/metatag_open_graph_products.info.yml +++ b/web/modules/metatag/metatag_open_graph_products/metatag_open_graph_products.info.yml @@ -7,7 +7,7 @@ dependencies: - metatag:metatag - metatag:metatag_open_graph -# Information added by Drupal.org packaging script on 2020-04-21 -version: '8.x-1.13' +# Information added by Drupal.org packaging script on 2020-08-11 +version: '8.x-1.14' project: 'metatag' -datestamp: 1587476386 +datestamp: 1597183854 diff --git a/web/modules/metatag/metatag_page_manager/metatag_page_manager.info.yml b/web/modules/metatag/metatag_page_manager/metatag_page_manager.info.yml index 24a9900cdb..e79b5d4017 100644 --- a/web/modules/metatag/metatag_page_manager/metatag_page_manager.info.yml +++ b/web/modules/metatag/metatag_page_manager/metatag_page_manager.info.yml @@ -7,7 +7,7 @@ dependencies: - page_manager:page_manager - metatag:metatag -# Information added by Drupal.org packaging script on 2020-04-21 -version: '8.x-1.13' +# Information added by Drupal.org packaging script on 2020-08-11 +version: '8.x-1.14' project: 'metatag' -datestamp: 1587476386 +datestamp: 1597183854 diff --git a/web/modules/metatag/metatag_page_manager/tests/src/Functional/MetatagPageManagerTest.php b/web/modules/metatag/metatag_page_manager/tests/src/Functional/MetatagPageManagerTest.php index 0a99dc5699..674da434c9 100644 --- a/web/modules/metatag/metatag_page_manager/tests/src/Functional/MetatagPageManagerTest.php +++ b/web/modules/metatag/metatag_page_manager/tests/src/Functional/MetatagPageManagerTest.php @@ -41,7 +41,6 @@ class MetatagPageManagerTest extends BrowserTestBase { * {@inheritdoc} */ public function setUp() { - // TODO: Change the autogenerated stub. parent::setUp(); $this->assertSession = $this->assertSession(); @@ -95,11 +94,9 @@ public function testSingleVariantPage() { } /** - * Tests a single variant page. - * - * @todo Fix this. + * Tests a multi-variant page. */ - public function _testMultipleVariantPage() { + public function testMultipleVariantPage() { // Make the old variant require an authenticated user. $old_variant = PageVariant::load('metatag_page_manager_variant_test'); $selection = [ @@ -109,12 +106,12 @@ public function _testMultipleVariantPage() { ], 'negate' => TRUE, 'context_mapping' => [ - 'user' => 'current_user', + 'user' => '@user.current_user_context:current_user', ], ]; $old_variant->set('selection_criteria', [$selection]); $old_variant->save(); - + // Add a new variant that only anonymous visitors can see. $new_variant = PageVariant::create([ 'id' => 'metatag_page_manager_multiple_variant_test', @@ -130,7 +127,7 @@ public function _testMultipleVariantPage() { ], 'negate' => FALSE, 'context_mapping' => [ - 'user' => 'current_user', + 'user' => '@user.current_user_context:current_user', ], ]; $new_variant->set('selection_criteria', [$selection]); @@ -184,7 +181,9 @@ public function _testMultipleVariantPage() { ]; $this->drupalPostForm('/admin/config/search/metatag/add', $edit, 'Save'); - $this->assertSession->pageTextContains('Page Variant: Metatag Page: Metatag Multiple Variant'); + // The first-weighted variant (Anonymous variant) will receive the Metatag + // defaults. + $this->assertSession->pageTextContains('Page Variant: Metatag Page: Anonymous variant'); // Clear caches to load the right metatags. drupal_flush_all_caches(); diff --git a/web/modules/metatag/metatag_pinterest/metatag_pinterest.info.yml b/web/modules/metatag/metatag_pinterest/metatag_pinterest.info.yml index 0ac66840f5..51054f5e80 100644 --- a/web/modules/metatag/metatag_pinterest/metatag_pinterest.info.yml +++ b/web/modules/metatag/metatag_pinterest/metatag_pinterest.info.yml @@ -6,7 +6,7 @@ package: SEO dependencies: - metatag:metatag -# Information added by Drupal.org packaging script on 2020-04-21 -version: '8.x-1.13' +# Information added by Drupal.org packaging script on 2020-08-11 +version: '8.x-1.14' project: 'metatag' -datestamp: 1587476386 +datestamp: 1597183854 diff --git a/web/modules/metatag/metatag_twitter_cards/metatag_twitter_cards.info.yml b/web/modules/metatag/metatag_twitter_cards/metatag_twitter_cards.info.yml index 82735bf1b0..d70703cce7 100644 --- a/web/modules/metatag/metatag_twitter_cards/metatag_twitter_cards.info.yml +++ b/web/modules/metatag/metatag_twitter_cards/metatag_twitter_cards.info.yml @@ -6,7 +6,7 @@ package: SEO dependencies: - metatag:metatag -# Information added by Drupal.org packaging script on 2020-04-21 -version: '8.x-1.13' +# Information added by Drupal.org packaging script on 2020-08-11 +version: '8.x-1.14' project: 'metatag' -datestamp: 1587476386 +datestamp: 1597183854 diff --git a/web/modules/metatag/metatag_verification/metatag_verification.info.yml b/web/modules/metatag/metatag_verification/metatag_verification.info.yml index 16b92834f8..39cebae115 100644 --- a/web/modules/metatag/metatag_verification/metatag_verification.info.yml +++ b/web/modules/metatag/metatag_verification/metatag_verification.info.yml @@ -6,7 +6,7 @@ package: SEO dependencies: - metatag:metatag -# Information added by Drupal.org packaging script on 2020-04-21 -version: '8.x-1.13' +# Information added by Drupal.org packaging script on 2020-08-11 +version: '8.x-1.14' project: 'metatag' -datestamp: 1587476386 +datestamp: 1597183854 diff --git a/web/modules/metatag/metatag_views/metatag_views.info.yml b/web/modules/metatag/metatag_views/metatag_views.info.yml index 14c69409ed..4aaf8e5386 100644 --- a/web/modules/metatag/metatag_views/metatag_views.info.yml +++ b/web/modules/metatag/metatag_views/metatag_views.info.yml @@ -7,7 +7,7 @@ dependencies: - metatag:metatag - drupal:views -# Information added by Drupal.org packaging script on 2020-04-21 -version: '8.x-1.13' +# Information added by Drupal.org packaging script on 2020-08-11 +version: '8.x-1.14' project: 'metatag' -datestamp: 1587476386 +datestamp: 1597183854 diff --git a/web/modules/metatag/metatag_views/src/Form/MetatagViewsTranslationForm.php b/web/modules/metatag/metatag_views/src/Form/MetatagViewsTranslationForm.php index d6c7ba7fcf..123cc3504f 100644 --- a/web/modules/metatag/metatag_views/src/Form/MetatagViewsTranslationForm.php +++ b/web/modules/metatag/metatag_views/src/Form/MetatagViewsTranslationForm.php @@ -14,7 +14,7 @@ use Drupal\Core\StringTranslation\StringTranslationTrait; /** - * Class MetatagViewsEditForm. + * Defines a form for translating meta tags for views. * * @package Drupal\metatag_views\Form */ diff --git a/web/modules/metatag/src/Plugin/GraphQL/Scalars/MetatagScalar.php b/web/modules/metatag/src/Plugin/GraphQL/Scalars/MetatagScalar.php index 05f4d86a22..105ef53668 100644 --- a/web/modules/metatag/src/Plugin/GraphQL/Scalars/MetatagScalar.php +++ b/web/modules/metatag/src/Plugin/GraphQL/Scalars/MetatagScalar.php @@ -2,7 +2,7 @@ namespace Drupal\metatag\Plugin\GraphQL\Scalars; -use Drupal\graphql\Plugin\GraphQL\DataProducer\DataProducerPluginBase; +use Drupal\graphql\Plugin\GraphQL\Scalars\Internal\StringScalar; /** * Metatag module dummy type. @@ -16,5 +16,5 @@ * type = "string" * ) */ -class MetatagScalar extends DataProducerPluginBase { +class MetatagScalar extends StringScalar { } diff --git a/web/modules/metatag/src/Plugin/migrate/process/d7/MetatagEntities.php b/web/modules/metatag/src/Plugin/migrate/process/d7/MetatagEntities.php index 6f709ae5f9..2f55a55bca 100644 --- a/web/modules/metatag/src/Plugin/migrate/process/d7/MetatagEntities.php +++ b/web/modules/metatag/src/Plugin/migrate/process/d7/MetatagEntities.php @@ -295,9 +295,9 @@ protected function tagsMap() { 'book:isbn' => 'book_isbn', 'book:release_date' => 'book_release_date', 'book:tag' => 'book_tag', - // @todo 'og:audio' => '', - // @todo 'og:audio:secure_url' => '', - // @todo 'og:audio:type' => '', + 'og:audio' => 'og_audio', + 'og:audio:secure_url' => 'og_audio_secure_url', + 'og:audio:type' => 'og_audio_type', 'og:country_name' => 'og_country_name', 'og:description' => 'og_description', 'og:determiner' => 'og_determiner', @@ -333,18 +333,18 @@ protected function tagsMap() { 'og:video:type' => 'og_video_type', 'og:video:url' => 'og_video_url', 'og:video:width' => 'og_video_width', - // @todo 'profile:first_name' => '', - // @todo 'profile:gender' => '', - // @todo 'profile:last_name' => '', - // @todo 'profile:username' => '', - // @todo 'video:actor' => '', - // @todo 'video:actor:role' => '', - // @todo 'video:director' => '', + 'profile:first_name' => 'profile_first_name', + 'profile:gender' => 'profile_gender', + 'profile:last_name' => 'profile_last_name', + 'profile:username' => 'profile_username', + 'video:actor' => 'video_actor', + 'video:actor:role' => 'video_actor_role', + 'video:director' => 'video_director', // @todo 'video:duration' => '', - // @todo 'video:release_date' => '', - // @todo 'video:series' => '', - // @todo 'video:tag' => '', - // @todo 'video:writer' => '', + 'video:release_date' => 'video_release_date', + 'video:series' => 'video_series', + 'video:tag' => 'video_tag', + 'video:writer' => 'video_writer', // From metatag_opengraph_products.metatag.inc: // https://www.drupal.org/project/metatag/issues/2835925 diff --git a/web/modules/metatag/src/Plugin/migrate/source/d6/NodewordsFieldInstance.php b/web/modules/metatag/src/Plugin/migrate/source/d6/NodewordsFieldInstance.php index c035355643..8f249de650 100644 --- a/web/modules/metatag/src/Plugin/migrate/source/d6/NodewordsFieldInstance.php +++ b/web/modules/metatag/src/Plugin/migrate/source/d6/NodewordsFieldInstance.php @@ -111,4 +111,11 @@ public function getIds() { return $ids; } + /** + * {@inheritdoc} + */ + public function count($refresh = FALSE) { + return $this->initializeIterator()->count(); + } + } diff --git a/web/modules/metatag/src/Plugin/migrate/source/d7/MetatagFieldInstance.php b/web/modules/metatag/src/Plugin/migrate/source/d7/MetatagFieldInstance.php index a0a73936cc..217f49c95b 100644 --- a/web/modules/metatag/src/Plugin/migrate/source/d7/MetatagFieldInstance.php +++ b/web/modules/metatag/src/Plugin/migrate/source/d7/MetatagFieldInstance.php @@ -90,4 +90,11 @@ public function getIds() { return $ids; } + /** + * {@inheritdoc} + */ + public function count($refresh = FALSE) { + return $this->initializeIterator()->count(); + } + } diff --git a/web/modules/metatag/tests/fixtures/d6_nodewords_entities.php b/web/modules/metatag/tests/fixtures/d6_nodewords.php similarity index 100% rename from web/modules/metatag/tests/fixtures/d6_nodewords_entities.php rename to web/modules/metatag/tests/fixtures/d6_nodewords.php diff --git a/web/modules/metatag/tests/fixtures/d7_metatag_entities.php b/web/modules/metatag/tests/fixtures/d7_metatag.php similarity index 100% rename from web/modules/metatag/tests/fixtures/d7_metatag_entities.php rename to web/modules/metatag/tests/fixtures/d7_metatag.php diff --git a/web/modules/metatag/tests/modules/metatag_test_custom_route/metatag_test_custom_route.info.yml b/web/modules/metatag/tests/modules/metatag_test_custom_route/metatag_test_custom_route.info.yml index 04803b6f88..86e1739af5 100644 --- a/web/modules/metatag/tests/modules/metatag_test_custom_route/metatag_test_custom_route.info.yml +++ b/web/modules/metatag/tests/modules/metatag_test_custom_route/metatag_test_custom_route.info.yml @@ -6,7 +6,7 @@ package: Testing dependencies: - metatag:metatag -# Information added by Drupal.org packaging script on 2020-04-21 -version: '8.x-1.13' +# Information added by Drupal.org packaging script on 2020-08-11 +version: '8.x-1.14' project: 'metatag' -datestamp: 1587476386 +datestamp: 1597183854 diff --git a/web/modules/metatag/tests/modules/metatag_test_integration/metatag_test_integration.info.yml b/web/modules/metatag/tests/modules/metatag_test_integration/metatag_test_integration.info.yml new file mode 100644 index 0000000000..abed889c2c --- /dev/null +++ b/web/modules/metatag/tests/modules/metatag_test_integration/metatag_test_integration.info.yml @@ -0,0 +1,11 @@ +name: "Metatag: Test Integration" +type: module +description: Support module for integration with metatag module. +package: Testing +dependencies: + - metatag:metatag + +# Information added by Drupal.org packaging script on 2020-08-11 +version: '8.x-1.14' +project: 'metatag' +datestamp: 1597183854 diff --git a/web/modules/metatag/tests/modules/metatag_test_integration/metatag_test_integration.module b/web/modules/metatag/tests/modules/metatag_test_integration/metatag_test_integration.module new file mode 100644 index 0000000000..42b8eae763 --- /dev/null +++ b/web/modules/metatag/tests/modules/metatag_test_integration/metatag_test_integration.module @@ -0,0 +1,72 @@ +<?php + +/** + * @file + * Contains metatag_test_integration.module. + */ + +/** + * Implements hook_metatags_attachments_alter(). + */ +function metatag_test_integration_metatags_attachments_alter(array &$attachments) { + $title = "This is the title I want | [site:name] | Yeah!"; + if (isset($title)) { + _metatag_test_integration_replace_tag('title', \Drupal::token()->replace($title), $attachments); + } +} + +/** + * Replaces meta tag in html head with given content. + * + * @param string $name + * The name of the tag to replace. + * @param string $content + * The content to use. + * @param array $attachments + * The array of attachments to act on. + */ +function _metatag_test_integration_replace_tag($name, $content, array &$attachments) { + if (empty($attachments['#attached'])) { + $attachments['#attached'] = []; + } + + if (empty($attachments['#attached']['html_head'])) { + $attachments['#attached']['html_head'] = []; + } + + $index = _metatag_test_integration_find_tag($name, $attachments); + + if ($index > -1) { + $attachments['#attached']['html_head'][$index][0]['#attributes']['content'] = $content; + } + else { + $attachments['#attached']['html_head'][] = [ + 0 => [ + '#attributes' => ['name' => $name, 'content' => $content], + '#tag' => 'meta', + ], + 1 => 'description', + ]; + } +} + +/** + * Finds the index of a meta tag in the html head. + * + * @param string $name + * The name of the tag to find. + * @param array $attachments + * The array of attachments to search. + * + * @return int + * The position in the attachment array that the tag is found in. -1 if the + * tag is not set. + */ +function _metatag_test_integration_find_tag($name, array $attachments) { + foreach ($attachments['#attached']['html_head'] as $index => $attachment) { + if ($attachment[1] == $name) { + return $index; + } + } + return -1; +} diff --git a/web/modules/metatag/tests/modules/metatag_test_tag/metatag_test_tag.info.yml b/web/modules/metatag/tests/modules/metatag_test_tag/metatag_test_tag.info.yml index ece7320862..61c1e2a62c 100644 --- a/web/modules/metatag/tests/modules/metatag_test_tag/metatag_test_tag.info.yml +++ b/web/modules/metatag/tests/modules/metatag_test_tag/metatag_test_tag.info.yml @@ -6,7 +6,7 @@ package: Testing dependencies: - metatag:metatag -# Information added by Drupal.org packaging script on 2020-04-21 -version: '8.x-1.13' +# Information added by Drupal.org packaging script on 2020-08-11 +version: '8.x-1.14' project: 'metatag' -datestamp: 1587476386 +datestamp: 1597183854 diff --git a/web/modules/metatag/tests/src/Functional/MetatagIntegrationTest.php b/web/modules/metatag/tests/src/Functional/MetatagIntegrationTest.php new file mode 100644 index 0000000000..1bab0b7029 --- /dev/null +++ b/web/modules/metatag/tests/src/Functional/MetatagIntegrationTest.php @@ -0,0 +1,41 @@ +<?php + +namespace Drupal\Tests\metatag\Functional; + +use Drupal\Tests\BrowserTestBase; + +/** + * Ensures that the Metatag hook_metatags_attachments_alter() works. + * + * @group metatag + */ +class MetatagIntegrationTest extends BrowserTestBase { + + /** + * {@inheritdoc} + */ + protected static $modules = [ + // The base module. + 'metatag', + + // Implements metatag_test_integration_metatags_attachments_alter(). + 'metatag_test_integration', + ]; + + /** + * {@inheritdoc} + */ + protected $defaultTheme = 'stark'; + + /** + * Tests hook_metatags_attachments_alter() and title altering. + * + * @see metatag_test_integration_metatags_attachments_alter() + */ + public function testHookMetatagsAttachmentsAlter() { + // Get the front page and assert the page title. + $this->drupalGet(''); + $this->assertSession()->titleEquals('This is the title I want | Drupal | Yeah!'); + } + +} diff --git a/web/modules/metatag/tests/src/Functional/MetatagPanelizerTest.php b/web/modules/metatag/tests/src/Functional/MetatagPanelizerTest.php new file mode 100644 index 0000000000..3defee9648 --- /dev/null +++ b/web/modules/metatag/tests/src/Functional/MetatagPanelizerTest.php @@ -0,0 +1,72 @@ +<?php + +namespace Drupal\Tests\metatag\Functional; + +use Drupal\Tests\BrowserTestBase; + +/** + * Verify that the JSON output from core works as intended. + * + * @group panelizer_metatag + */ +class MetatagPanelizerTest extends BrowserTestBase { + + // Contains helper methods. + use MetatagHelperTrait; + + /** + * {@inheritdoc} + */ + public static $modules = [ + // Modules for core functionality. + 'node', + 'field', + 'field_ui', + 'user', + + // Contrib dependencies. + 'panelizer', + 'token', + + // This module. + 'metatag', + ]; + + /** + * {@inheritdoc} + */ + protected $defaultTheme = 'bartik'; + + /** + * Create an entity, view its JSON output, confirm Metatag data exists. + */ + public function testPanelizerMetatagPreRender() { + /* @var\Drupal\node\NodeInterface $node */ + $title = 'Panelizer Metatag Test Title'; + $body = 'Testing JSON output for a content type'; + $node = $this->createContentTypeNode($title, $body); + $url = $node->toUrl(); + + // Initiate session with a user who can manage metatags. + $permissions = ['administer node display', 'administer meta tags']; + $account = $this->drupalCreateUser($permissions); + $this->drupalLogin($account); + + // Load the node's page. + $this->drupalPostForm( + 'admin/structure/types/manage/metatag_test/display', + ['panelizer[enable]' => TRUE], + 'Save' + ); + + $this->drupalGet('admin/structure/types/manage/metatag_test/display'); + $this->assertSession()->checkboxChecked('panelizer[enable]'); + + $this->drupalGet($url); + $this->assertSession()->elementContains('css', 'title', $title . ' | Drupal'); + $xpath = $this->xpath("//link[@rel='canonical']"); + self::assertEquals((string) $xpath[0]->getAttribute('href'), $url->toString()); + self::assertEquals(count($xpath), 1); + } + +} diff --git a/web/modules/metatag/tests/src/Kernel/Migrate/d6/NodewordsEntitiesTest.php b/web/modules/metatag/tests/src/Kernel/Migrate/d6/NodewordsEntitiesTest.php index db28f511ee..a189c5f129 100644 --- a/web/modules/metatag/tests/src/Kernel/Migrate/d6/NodewordsEntitiesTest.php +++ b/web/modules/metatag/tests/src/Kernel/Migrate/d6/NodewordsEntitiesTest.php @@ -77,7 +77,7 @@ protected function fileMigrationSetup() { */ protected function setUp() { parent::setUp(); - $this->loadFixture(__DIR__ . '/../../../../fixtures/d6_nodewords_entities.php'); + $this->loadFixture(__DIR__ . '/../../../../fixtures/d6_nodewords.php'); $this->installEntitySchema('user'); $this->installEntitySchema('node'); diff --git a/web/modules/metatag/tests/src/Kernel/Migrate/d7/MetatagEntitiesTest.php b/web/modules/metatag/tests/src/Kernel/Migrate/d7/MetatagEntitiesTest.php index 256f9a04e3..9299032c6d 100644 --- a/web/modules/metatag/tests/src/Kernel/Migrate/d7/MetatagEntitiesTest.php +++ b/web/modules/metatag/tests/src/Kernel/Migrate/d7/MetatagEntitiesTest.php @@ -26,9 +26,11 @@ class MetatagEntitiesTest extends MigrateDrupal7TestBase { // Core modules. // @see testAvailableConfigEntities 'comment', + 'content_translation', 'datetime', 'filter', 'image', + 'language', 'link', 'menu_link_content', 'menu_ui', @@ -76,8 +78,11 @@ protected function fileMigrationSetup() { * {@inheritdoc} */ protected function setUp() { + if (version_compare(\Drupal::VERSION, '8.9', '<')) { + $this->markTestSkipped('This test requires at least Drupal 8.9'); + } parent::setUp(); - $this->loadFixture(__DIR__ . '/../../../../fixtures/d7_metatag_entities.php'); + $this->loadFixture(__DIR__ . '/../../../../fixtures/d7_metatag.php'); $this->installEntitySchema('node'); $this->installEntitySchema('comment'); @@ -89,6 +94,7 @@ protected function setUp() { $this->installEntitySchema('metatag_defaults'); $this->executeMigrations([ + 'language', 'd7_metatag_field', 'd7_node_type', 'd7_taxonomy_vocabulary', @@ -99,14 +105,11 @@ protected function setUp() { 'd7_comment_type', 'd7_field', 'd7_field_instance', + 'd7_language_content_settings', ]); $this->fileMigrationSetup(); $this->executeMigrations([ - 'd7_node:test_content_type', - 'd7_node:article', - 'd7_node:forum', - 'd7_node:blog', - 'd7_node_revision:test_content_type', + 'd7_node_complete', 'd7_taxonomy_term', ]); } diff --git a/web/modules/metatag/tests/src/Kernel/Plugin/migrate/source/d6/NodewordsFieldInstanceTest.php b/web/modules/metatag/tests/src/Kernel/Plugin/migrate/source/d6/NodewordsFieldInstanceTest.php index e4eb91d2cd..553216fdaa 100644 --- a/web/modules/metatag/tests/src/Kernel/Plugin/migrate/source/d6/NodewordsFieldInstanceTest.php +++ b/web/modules/metatag/tests/src/Kernel/Plugin/migrate/source/d6/NodewordsFieldInstanceTest.php @@ -110,9 +110,6 @@ public function providerSource() { ], ]; - // The source query has 3 rows, so hardcode this value so the test passes. - // @todo This feels like cheating? - $tests[0]['expected_count'] = 3; return $tests; } diff --git a/web/modules/metatag/tests/src/Kernel/Plugin/migrate/source/d7/MetatagFieldInstanceTest.php b/web/modules/metatag/tests/src/Kernel/Plugin/migrate/source/d7/MetatagFieldInstanceTest.php index 3da7b45f38..df9be4c1a1 100644 --- a/web/modules/metatag/tests/src/Kernel/Plugin/migrate/source/d7/MetatagFieldInstanceTest.php +++ b/web/modules/metatag/tests/src/Kernel/Plugin/migrate/source/d7/MetatagFieldInstanceTest.php @@ -105,9 +105,6 @@ public function providerSource() { ], ]; - // The source query has 3 rows, so hardcode this value so the test passes. - // @todo This feels like cheating? - $tests[0]['expected_count'] = 3; return $tests; } -- GitLab