Problem/Motivation
The repackage / rebuild language list form at admin/l10n_server/packager is always calling the submit function for the button "Rebuild language list" no matter which button you click.
The problem here is that the #submit values for bot buttons under project translations get ignored and therefore there's no way to repackage or mark projects for repackaging from the interface.
Proposed resolution
(description of the proposed solution, the rationale behind it, and workarounds for people who cannot use the patch)
It seems that the array_merge at l10n_packager_admin_repackage_page() is meesing up the form. Maybe we could change that to two different forms or fix it so it doesn't beak.
Although another bug arises when the button works and l10n_packager_admin_projects_form_submit gets called, repackage now will fail with:
An AJAX HTTP error occurred. HTTP Result Code: 500 Debugging information follows. Path: /?q=batch&id=4&op=do StatusText: error ResponseText: PDOException: SQLSTATE[HY000]: General error: 1364 Field 'fid' doesn't have a default value: INSERT INTO {l10n_packager_file} (rid, language, checked, sid_count) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3); Array ( [:db_insert_placeholder_0] => 3 [:db_insert_placeholder_1] => es [:db_insert_placeholder_2] => 1335481282 [:db_insert_placeholder_3] => 5 ) in drupal_write_record() (line 6975 of /home/checkout/l10n_server/includes/common.inc).
Although that shuld probably be filled as a different issue.
Remaining tasks
Writing a patch, testing it, reviewing it and committing it.
User interface changes
It should look the same but might get changed to two different forms.
API changes
none.
Comments
Comment #1
lucascaro commentedHi again, here's a patch that makes the form work. This exposes a bug in l10n_packager_release_check ("An AJAX HTTP error occurred. HTTP Result Code: 500") that would probably be better handled as a different issue.
Please let me know what you think,
Lucas.
Comment #2
lucascaro commentedComment #3
lucascaro commentedHere's a second patch that fixes also the ajax error. It was caused by changes in the file api:
* the table name changed from file to file_managed
* $file->filepath is now $file->uri
after this patch, the packager generates the required files after pressing the repackage now button at admin/l10n_server/packager.
Comment #4
lucascaro commentedHere's yet another patch, where I've also changed all instances of $file->filepath to $file->uri.
Comment #5
SebCorbin commentedActually I did a patch very similar to the #1 a while ago, I attached it here.
A merge of the two -my version for the repackaging form (I prefer render arrays instead of array_merge) and your version for ajax- would be nice, what do you think?
Comment #6
lucascaro commentedI agree, I'll submit the merged patch today.
Comment #7
lucascaro commentedhere it is!
edit: disregard this patch since it has more changes than it should., see #8
Comment #8
lucascaro commentedugh, another change for an unrelated issue hitchhiked on #7 so here's #4 merged with @SebCorbin 's #5
Comment #9
SebCorbin commented#8 committed