Untranslated link is being shared as default

Created on 12 October 2020, over 3 years ago
Updated 24 January 2024, 5 months ago

Problem/Motivation

My D8 site is currently shown in 3 languages (Spanish, Portuguese and English) with Spanish being set as first in the Drupal language hierarchy. That being said, whenever I use the sharing links provided by Share Everywhere (while browsing in either English, Portuguese or Spanish) only the Spanish links are being shown.

The sharing links are exposed through a View as a preview box, where there is also a button to go the content itself. The preview box's button link does translate properly for all languages.

Steps to reproduce

Install Drupal 8 in more than two languages and the sharing links provided by Share Everywhere will be shown in the first language according to Drupal hierarchy.

πŸ› Bug report
Status

Needs review

Version

2.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡¦Ukraine paulrad

    Hey, @dench0!
    I'm not sure why you've decided to add language_manager and entity_type.manager services, since it's not used anywhere.
    Also, you've used {@inheritdoc} in the getEntityTypeManager() function, which is not correct, as FieldPluginBase and/or EntityTranslationRenderTrait didn't have a function with such a name.

    After implementing your patch, I've got an WSOD with a message:

    The website encountered an unexpected error. Please try again later.
    Error: Call to undefined method Drupal\share_everywhere\Plugin\views\field\ShareEverywhereField::getEntityRepository() in Drupal\share_everywhere\Plugin\views\field\ShareEverywhereField->getEntityTranslation() (line 77 of core/modules/views/src/Entity/Render/EntityTranslationRenderTrait.php).

    Assigning this task to myself and will prepare a merge request.

  • Open on Drupal.org β†’
    Core: 9.5.x + Environment: PHP 7.4 & MySQL 5.7
    last update 8 months ago
    Waiting for branch to pass
  • @paulrad opened merge request.
  • Issue was unassigned.
  • Status changed to Needs review 8 months ago
  • πŸ‡ΊπŸ‡¦Ukraine paulrad
  • πŸ‡ΊπŸ‡¦Ukraine paulrad

    Can any maintainer review this issue?

Production build 0.69.0 2024