- Issue created by @BramDriesen
- 🇧🇪Belgium BramDriesen Belgium 🇧🇪
Uploading patches.
#21 by: bojan_dev
#22 by: StanleyFernandesWe are using #21 for quite some time in prod now.
- Status changed to Needs review
12 months ago 10:24am 1 February 2024 - Open on Drupal.org →Core: 9.5.x + Environment: PHP 7.4 & MySQL 5.7last update
12 months ago Waiting for branch to pass - Open on Drupal.org →Core: 9.5.x + Environment: PHP 7.4 & MySQL 5.7last update
12 months ago Waiting for branch to pass - Open on Drupal.org →Core: 9.5.x + Environment: PHP 7.4 & MySQL 5.7last update
7 months ago Waiting for branch to pass - 🇨🇴Colombia carma03
Confirming patch yoast_seo-3110455-22.patch → works for me on D10.2.6, PHP 8.1.29, Apache 2.4.41 and MySQL5.7.
Thanks @BramDriesen → and @Drumanuel →
- Status changed to RTBC
6 months ago 6:20am 13 August 2024 -
kingdutch →
committed b59fac39 on 8.x-2.x
Issue #3418620 by bramdriesen, drumanuel, carma03: Metatags depending on...
-
kingdutch →
committed b59fac39 on 8.x-2.x
- 🇳🇱Netherlands kingdutch
Thanks for the contribution! I've gone with the smaller fix:
diff --git a/src/EntityAnalyser.php b/src/EntityAnalyser.php index 0734233..e6555cf 100644 --- a/src/EntityAnalyser.php +++ b/src/EntityAnalyser.php @@ -213,7 +213,7 @@ class EntityAnalyser { foreach ($metatags as $tag => $value) { $metatags[$tag] = str_replace('[current-page:title]', $entity->label() ?? '', $value); // URL metatags cause issues for new nodes as they don't have a URL yet. - if ($entity->isNew() && (substr($tag, -4) === '_url')) { + if ($entity->isNew() && preg_match('/[.\-_:]url/', $value)) { $metatags[$tag] = ''; } }
The other patch also changed the logic of the title by moving
$entity->isNew()
outside of the loop altogether, which seemed to do something differently than what was needed for the bug report.If this issue persists, please ping me on Slack and we can replace it by one of the other patches.
Automatically closed - issue fixed for 2 weeks with no activity.