Problem/Motivation

Drupal 7 keeps one l10n_packager_file row per release and language, so a release has one packaged .po per language. On 3.0.x the l10n_packager_file storage schema declares unique keys on rid and on fid, so a release can hold exactly one packaged file. Packaging a release with translations in two languages fails on the second one with 'Duplicate entry '1' for key 'l10n_packager_file_field__rid'' and the packager stops.

Steps to reproduce

Replace the unique key on rid with a composite unique key on rid and language, like Drupal 7. fid stays unique. No update path, 3.0.x sites are new installs.

Covered by a Drupal 7 test (L10nPackagerTestCase::testPackageFilePerLanguage()) that packages a release with Hungarian and German translations, checks the file paths and contents, and checks that a new translation repackages only that language in place. Its port, PackagerFilePerLanguageTest in the l10n_packager kernel tests, fails with the duplicate key error before the change.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

l10n_packager_file gets a unique key on (rid, language) instead of rid.

LLM disclosure

LLM was used to find, diagnose explain and fix this issue. With human review.

Comments

gábor hojtsy created an issue. See original summary.

  • c30d9c08 committed on 3.0.x
    fix #3621247: Only one language can be packaged per release
    
    Unique key...

  • fb835dc9 committed on 7.x-1.x
    fix #3621247: Only one language can be packaged per release
    
    Add test...
gábor hojtsy’s picture

Status: Active » Fixed

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.

Status: Fixed » Closed (fixed)

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