Problem/Motivation

If Babel is installed, and I try to translate strings on the Locale module's form ("interface translation"), then after clicking the "Save" button, I get the message "The website encountered an unexpected error. Try again later."

Core commit hash: 5b5471a
Babel: d9e330c

Steps to reproduce

1. drush si -y && drush en babel -y && drush php:eval "\Drupal\language\Entity\ConfigurableLanguage::createFromLangcode('hr')->save()"
2. drush uli "admin/config/regional/translate?string=Drupal announcements"
3. Translate one of the strings and hit save.
4. "The website encountered an unexpected error. Try again later."

If you set up the Drupal instance without installing Babel, saving translations here works properly
(Just replace first command with: drush si -y && drush en locale -y && drush php:eval "\Drupal\language\Entity\ConfigurableLanguage::createFromLangcode('hr')->save()")

User interface changes

API changes

Data model changes

Issue fork babel-3551795

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

huzooka created an issue. See original summary.

huzooka’s picture

Issue summary: View changes
saidatom’s picture

Assigned: Unassigned » saidatom
saidatom’s picture

Changes:

babel.services.yml

  • Removed needs_destruction tag from LocaleSubscriber service definition

src/EventSubscriber/LocaleSubscriber.php

  • Added check to return early if $event->getLids() is empty
  • Prevents attempting to query with an empty array in the IN condition, which can cause database errors

saidatom’s picture

Assigned: saidatom » Unassigned
Status: Active » Needs review
alorenc’s picture

Assigned: Unassigned » alorenc
alorenc’s picture

Status: Needs review » Reviewed & tested by the community
alorenc’s picture

Assigned: alorenc » Unassigned
Status: Reviewed & tested by the community » Fixed

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

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

Maintainers, please credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.