I adapted the l10n_install translations import task to a custom install profile and found a bug in the l10n_update (or in Schema API, as explained later). In the install profile a hook_profile_modules implementation describes the modules to be enabled. When adding contrib modules in the array prior to 'locale' these modules will not be enabled, and more translation imports fails. However, if the contrib modules are appended to the end of the $modules array, the process works as it should be.
Listing modules that implements hook_schema() in hook_profile_modules() will break the l10n_update_build_projects() function, more precisely the call to drupal_write_record() (it will not persist the passed data) that rely on the Schema API.
It's possible to reproduce the above behavior using the l10n_install profile. You will need to download the profile and patch it to list some additional modules (Date API, Date Timezone and Views):
drush dl l10n_install-6.x-1.0-beta4
cd l10n_install
drush dl views date
cd profiles/l10n_install
wget https://gist.github.com/raw/1290426/daa4b934b6906d3cd218ae9d78b1c676c5124b3f/l10n_install-modules.patch
patch -p0 < l10n_install-modules.patch
Then proceed with the installation. Select a language that have Date and Views translations (Portuguese, Brazil does have). In the install step "Download and import translations", the batch will process anything and will proceed to the next install step.
Then, patch the l10n_update module with the attached patch and try again. The translations will be downloaded and imported.
The hook_profile_modules implementation below does work correctly.
/**
* Implementation of hook_profile_modules().
*/
function l10n_install_profile_modules() {
$modules = array('color', 'comment', 'help', 'menu', 'taxonomy', 'dblog', 'locale', 'l10n_client', 'l10n_update', 'views', 'date_api', 'date_timezone');
return $modules;
}
| Comment | File | Size | Author |
|---|---|---|---|
| l10n_update-build_projects_schema_issue.patch | 1.57 KB | Anonymous (not verified) |
Comments
Comment #1
sutharsan commentedThe above script is incomplete, broken or unclear. I can't use it to reconstruct the situation. Get you give more directions on how to reproduce your problem?
Comment #2
sutharsan commentedNo response, closing the issue. Feel free to re-open if you have more information.
Comment #2.0
sutharsan commentedSummary of the problem added. Confusing paragraph replaced.