Steps to reproduce:
1.) install aegir 7.x-3.x
2.) Add openatrium 6.x as a platform
3.) view the platform node.

I get a couple undefined indexes where OA provides a translation that is no found in the Aegir Hostmaster Drupal root.

The offending code is in hosting_package.module line 393.

function _hosting_language_name($language) {
  include_once DRUPAL_ROOT . '/includes/iso.inc';
  $locales = _locale_get_predefined_list();
  return $locales[$language][0] . (isset($locales[$language][1]) ? ' ' . t('(@language)', array('@language' => $locales[$language][1])) : '');
}

Its pulling the list of languages from hostmaster's includes instead of the platform's.

Im not sure what the best way to correct this is, but here is a patch that fixes the errors (however, the end result is that the language title isnt shown in the language list, just the language code).

CommentFileSizeAuthor
adjust-language-name.patch768 byteschertzog

Comments

anarcat’s picture

the problem here is:

  include_once DRUPAL_ROOT . '/includes/iso.inc';

like most of aegir, any time we directly talk to drupal without going through the backend, it's usually a mistake. in this case, we don't talk to the right platform: we only look into hostmaster.

the proper way of doing this would be to take data that is coming from a provision-verify, but i don't remember if that data is currently provided at all by the backend, let alone stored in the frontend. in the packages tables maybe?

nevertheless, your patch looks sound.

chertzog’s picture

For the record, the 2 missing translations are "tyv" and "mfe".

ergonlogic’s picture

Status: Needs review » Needs work

I've seen something similar, and wondered what was causing it...

Anyway, it looks like we're tracking the profile languages in hosting_package_languages:

mysql> select i.iid, package_id, filename, language from hosting_package_instance i join hosting_package_languages l where i.iid = l.iid;
+-----+------------+----------------------------------------------------------------------+----------+
| iid | package_id | filename                                                             | language |
+-----+------------+----------------------------------------------------------------------+----------+
|  41 |          9 | /var/aegir/hostmaster-6.x-2.x/profiles/hostmaster/hostmaster.profile | en       |
|  42 |         51 | /var/aegir/hostmaster-6.x-2.x/profiles/default/default.profile       | en       |
| 120 |          9 | /var/aegir/hostmaster-6.x-2.x/profiles/hostmaster/hostmaster.profile | en       |
| 121 |         51 | /var/aegir/hostmaster-6.x-2.x/profiles/default/default.profile       | en       |
| 162 |          9 | /var/aegir/hostmaster-6.x-2.x/profiles/hostmaster/hostmaster.profile | en       |
| 163 |         51 | /var/aegir/hostmaster-6.x-2.x/profiles/default/default.profile       | en       |
| 283 |         51 | /var/aegir/hostmaster-6.x-2.x/profiles/default/default.profile       | en       |
| 242 |          9 | /var/aegir/hostmaster-6.x-2.x/profiles/hostmaster/hostmaster.profile | en       |
+-----+------------+----------------------------------------------------------------------+----------+
8 rows in set (0.00 sec)

So I guess we should pull the data from there.

ergonlogic’s picture

Version: 6.x-2.x-dev » 7.x-3.x-dev
Issue summary: View changes

Misfiled version number?