Problem/Motivation

When creating a new poll (not translating an existing one) old polls on different languages are removed. As an example if i have a poll translated in both Romanian and English and i create an new poll in English the latter will replace the old one as it should be but the Romanian page that should show the old poll will not.

Steps to reproduce

Creat a poll and translated in two different languages. The poll will appear as expected in both. Create a new poll in one language. The latter language will show the poll but the former language will show no poll.

Proposed resolution

Add language in getMostRecentPoll query

  public function getMostRecentPoll() {
    $language_code = \Drupal::languageManager()->getCurrentLanguage()->getId();
    $query = \Drupal::entityQuery('poll')
      ->condition('status', POLL_PUBLISHED)
      ->condition('langcode', $language_code)
      ->accessCheck(TRUE)
      ->sort('created', 'DESC')
      ->pager(1);
    return $this->loadMultiple($query->execute());
  }

Remaining tasks

User interface changes

API changes

Data model changes

Issue fork poll-3392165

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

dithomas created an issue. See original summary.

dithomas’s picture

Issue summary: View changes
bramdriesen’s picture

Version: 8.x-1.6 » 2.0.x-dev
Priority: Normal » Major
Issue tags: -poll, -multilanguage +Needs tests, +Needs issue fork

Going to classify this one as major as well!

bramdriesen’s picture

Status: Active » Needs work
Issue tags: -Needs issue fork
ivnish’s picture

I can't reproduce this with the latest dev

ivnish’s picture

Status: Needs work » Postponed (maintainer needs more info)

Needs @bramdriesen test

ivnish’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)
Issue tags: -Needs tests

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.