web/modules/custom/custom_page/custom_page.module (line 139) |
custom_page_node_update() updates all menu links' titles using $entity->getTitle(). This can overwrite translated menu link titles with the title of the translation being saved. |
High |
Load the corresponding translation of the menu link if available, or use getTranslation() on the node before setting the title. |
web/modules/custom/custom_page/src/CustomPageOgMenuLinksManager.php (lines 44, 56, 114) |
getChildren() and moveLinks() query menu links by URI (entity:node/{$id}) without filtering by language, which can result in picking up links from all translations. |
Mid |
Add a langcode condition to the entity query to target only the relevant translation. |
web/modules/custom/custom_page/src/CustomPageOgMenuLinksManager.php (line 92) |
addLink() creates menu links with $customPage->label() without setting langcode. Links are created in the site's default language regardless of the node's language. |
High |
Pass the $customPage->language()->getId() to the menu_link_content entity creation and use $customPage->label() from the correct translation. |
web/modules/custom/eu_oss_catalogue/modules/eu_oss_translation/src/Plugin/QueueWorker/TranslationRequester.php (line 59) |
processItem() loads a node by ID without specifying a translation, which might lead to incorrect translation job creation. |
High |
Load the specific translation using getTranslation() or ensure the loader is language-aware. |
web/modules/custom/joinup_communities/joinup_oss_catalogue/joinup_oss_catalogue.module (line 130) |
joinup_oss_catalogue_preprocess_field__in_modal() uses $entity->label() for a label string without ensuring it's in the correct language. |
Mid |
Use getTranslationFromContext($entity)->label(). |
web/modules/custom/joinup_communities/joinup_oss_catalogue/src/Plugin/Field/FieldFormatter/EntityReferenceLabelTooltip.php (line 128) |
getTooltipText() uses token replacement for tooltip text without ensuring language context. |
High |
Pass the langcode to Token::replace(). |
web/modules/custom/joinup_core/joinup_core.module (line 175) |
joinup_core_file_delete() uses $entity->label() and $group->label() in log messages without translation. |
Low |
Use the default language for logging or ensure the labels are consistently retrieved. |
web/modules/custom/joinup_core/src/Plugin/Field/FieldFormatter/EntityReferenceCustomLinkFormatter.php (line 150) |
viewElements() uses token replacement for link labels without ensuring the tokens are replaced using the correct language context. |
High |
Pass the langcode to Token::replace() to ensure translated tokens are used. |
web/modules/custom/joinup_core/src/Plugin/Field/FieldFormatter/UrlFormatterWithCustomTitle.php (line 86) |
viewElements() uses a custom link label from settings without translation context, potentially showing the same label in all languages. |
High |
Wrap the custom title in t() if it's a fixed string or use config translation for the formatter settings. |
web/modules/custom/joinup_core/src/Plugin/QueueWorker/DisableEiraTermsSolutionWorker.php (line 69) |
processItem() loads a node by ID without translation context. While the field updated is not translatable, the pattern ignores language. |
Low |
Good practice to load the default translation explicitly if only updating non-translatable fields. |
web/modules/custom/joinup_distribution/joinup_distribution.module (line 182) |
joinup_distribution_preprocess_views_view_field() uses $entity->label() for a link in a view of download events, potentially using the default language label. |
Low |
Use the langcode from the view row or current context. |
web/modules/custom/joinup_group/joinup_group.module (line 211) |
joinup_group_preprocess() uses $parent->label() for data-joinup-parent-label. In a multilingual site, the parent's label might be in a different language than the page's. |
Low |
Ensure the parent entity is loaded in the same language as the current entity using getTranslationFromContext(). |
web/modules/custom/joinup_group/joinup_group.module (lines 465, 1026) |
Various hooks and methods use $entity->label() for logging or messages. While mostly cosmetic, it can cause confusion in a multi-lingual site. |
Low |
Explicitly use the default language for logs or the user's interface language for messages. |
web/modules/custom/joinup_group/joinup_group.module (line 910) |
joinup_group_entity_update() compares labels to decide if it should queue URL alias updates. It might not trigger updates if only a translation's label changes. |
Mid |
Compare labels for each translation or iterate over $entity->getTranslationLanguages() to check for changes. |
web/modules/custom/joinup_group/src/Plugin/QueueWorker/JoinupGroupContentQueueWorker.php (line 53) |
processItem() loads an entity by ID without translation context. The subsequent updateEntityAlias() call might only update the default translation's alias. |
Mid |
Ensure updateEntityAlias() handles all translations or pass the langcode in the queue item. |
web/modules/custom/joinup_notification/joinup_notification.module (line 138) |
joinup_notification_mail_alter() uses a hardcoded fallback for first name and passes it through t(), but does not explicitly set the translation context to the recipient's language. |
Low |
Provide the langcode option to the t() function or TranslatableMarkup. |
web/modules/custom/joinup_notification/src/EventSubscriber/NotificationSubscriberBase.php (line 144) |
generateArguments() uses $entity->label() for the @entity:title argument. Emails might use the default translation title instead of the content's or recipient's language. |
Mid |
Use $entity->getTranslation($recipient_langcode)->label() when generating notification arguments. |
web/modules/custom/joinup_notification/src/MessageArgumentGenerator.php (lines 142, 175) |
getGroupArguments() and getOgMembershipArguments() use $group->label() for email arguments, which may result in recipients receiving emails in a language they didn't expect. |
Mid |
Load the translation matching the recipient's preferred language ($user->getPreferredLangcode()). |
web/modules/custom/joinup_paragraphs/joinup_paragraphs.module (line 136) |
joinup_paragraphs_preprocess_layout_paragraphs_insert_component_btn() compares a TranslatableMarkup with a hardcoded English string 'Add section'. This might fail if the site default language is different. |
Mid |
Compare the untranslated string or use the getUntranslatedString() method of TranslatableMarkup. |
web/modules/custom/joinup_release/joinup_release.module (lines 211, 264) |
joinup_release_preprocess_node() and joinup_release_preprocess_page_title__node__release() use $release->label() to build a full label without translation context. |
Mid |
Ensure the release entity is in the current context's language. |
web/modules/custom/joinup_seo/src/JoinupSeoExportHelper.php (line 62) |
exportEntityJsonLd() serializes entities for SEO. It needs to be verified if it handles translations correctly or if it only exports the default translation. |
Mid |
Pass the active language context to the serializer or iterate over available translations. |
web/modules/custom/topic/topic.module (lines 48, 77) |
topic_taxonomy_term_update() and topic_meta_entity_presave() synchronize a meta_entity label with a term label using $term->label(), ignoring possible term translations. |
Mid |
Use $term->getTranslation($langcode)->label() to ensure synchronization across all languages. |
web/modules/custom/topic/topic.module (line 134) |
topic_form_entity_subqueue_homepage_topics_validate() uses $meta_entity->label() for an error message, which will be in the default language regardless of the user's interface language. |
Low |
Use getTranslationFromContext($meta_entity) to display the label in the user's language. |
web/themes/ventuno/includes/page_title.inc (line 19) |
ventuno_preprocess_page_title() uses getSingularLabel() for a bundle label without ensuring it is translated. |
Mid |
Use \Drupal::service('entity.repository')->getTranslationFromContext($entity->get('type')->entity) to get the translated bundle label. |
web/themes/ventuno/includes/page_title.inc (line 28) |
ventuno_preprocess_page_title() uses $solution->label() for a title string without translation context. |
Mid |
Use getTranslationFromContext($solution)->label(). |
web/themes/ventuno/includes/utility.inc (line 95) |
_ventuno_preprocess_tile() uses $bundle_type->label() for tile labels. If the bundle label is translated, the tile might show the default translation instead of the current language. |
Mid |
Use \Drupal::service('entity.repository')->getTranslationFromContext($bundle_type) to get the translated bundle label. |