- Issue created by @useernamee
- Merge request !33#3410567: Custom elements metatags generator handles translations of some config entities as well. → (Merged) created by useernamee
- last update
11 months ago 9 pass - 🇸🇮Slovenia useernamee Ljubljana
I've lessened the condition for metatags links generation. Check PR.
I'm also adding a patch file.
- Status changed to Needs review
11 months ago 4:02pm 22 December 2023 - last update
11 months ago 9 pass - 🇸🇮Slovenia useernamee Ljubljana
This solution works for me, but I've just figured it out that it only adds webform translations if content_translation module is installed which is not optimal. https://git.drupalcode.org/project/lupus_ce_renderer/-/merge_requests/33...
This condition might need some more consideration.
- Status changed to Needs work
11 months ago 2:37pm 31 December 2023 - 🇦🇹Austria fago Vienna
> if (array_diff(['hasLinkTemplate', 'getTranslationLanguages'], get_class_methods($entity)) &&
This should check for the dedicated interface we need. each method should be provided by a suiting more narrow interface, content-entity-interface is a collection of those. Let's checked for the specific ones with an OR statement so this is a) nicer and b) easier to follow
> This solution works for me, but I've just figured it out that it only adds webform translations if content_translation module is installed which is not optimal. https://git.drupalcode.org/project/lupus_ce_renderer/-/merge_requests/33...
This is not really nice, indeed, but I think good enough. In practice only people having that module installed will want to have these metatags, so let's just keep doing it that way.
- 🇸🇮Slovenia useernamee Ljubljana
Alternatively we could use:
if (($entity instanceof ContentEntityInterface || $entity instanceof WebformInterface) && $entity->hasLinkTemplate('canonical') && // Only add alternate link if entity is translated. count($entity->getTranslationLanguages()) > 1) {
but I don't like this solution either.
getTranslationLanguages
is defined on WebformInterface and the problem with this is that it is too specific for my taste. It might cause issues if webform is not installed.ContentEntityInterface
(ultimately) inherits the method fromweb/core/lib/Drupal/Core/TypedData/TranslatableInterface.php
but that is not the case for Config entities. - Assigned to fago
- 🇦🇹Austria fago Vienna
Could we do something like
if (($entity instanceof ContentEntityInterface ||
(class_exists(WebformInterface) && $entity instanceof WebformInterface))? so we keep the check clean on interfaces, but still do work fine if webform module is not there. It also better documents why we are doing this. (webform)
- 6f0ef973 committed on 3410567-webforms-are-missing
#3410567: Fix condition to genereate alternate links for webforms.
- 6f0ef973 committed on 3410567-webforms-are-missing
- Status changed to Needs review
10 months ago 11:30am 23 January 2024 - Open on Drupal.org →Core: 9.5.x + Environment: PHP 8.1 & MySQL 5.7last update
10 months ago Not currently mergeable. - last update
10 months ago 9 pass - last update
10 months ago 9 pass - last update
10 months ago 9 pass - last update
10 months ago 9 pass -
useernamee →
committed edcdaaea on 2.x
Issue #3410567 by useernamee, fago: Webforms are missing metatags...
-
useernamee →
committed edcdaaea on 2.x
- Status changed to Fixed
10 months ago 3:05pm 31 January 2024 Automatically closed - issue fixed for 2 weeks with no activity.