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
Comment #4
gábor hojtsy