uppdated modules

This commit is contained in:
Bachir Soussi Chiadmi
2017-01-22 16:19:36 +01:00
parent 03be8f82aa
commit 8416e3eea1
748 changed files with 32317 additions and 20900 deletions
@@ -8,9 +8,9 @@ files[] = i18n_object.inc
files[] = i18n.test
configure = admin/config/regional/i18n
; Information added by Drupal.org packaging script on 2015-01-26
version = "7.x-1.12"
; Information added by Drupal.org packaging script on 2016-10-22
version = "7.x-1.14"
core = "7.x"
project = "i18n"
datestamp = "1422286982"
datestamp = "1477154943"
@@ -11,7 +11,7 @@ class Drupali18nTestCase extends DrupalWebTestCase {
function setUpLanguages($admin_permissions = array()) {
// Setup admin user.
$this->admin_user = $this->drupalCreateUser(array_merge(array('bypass node access', 'administer nodes', 'administer languages', 'administer content types', 'administer blocks', 'access administration pages', 'translate interface'), $admin_permissions));
$this->admin_user = $this->drupalCreateUser(array_merge(array('bypass node access', 'administer nodes', 'administer languages', 'administer content types', 'administer fields', 'administer blocks', 'access administration pages', 'translate interface'), $admin_permissions));
$this->drupalLogin($this->admin_user);
@@ -362,6 +362,7 @@ class Drupali18nTestCase extends DrupalWebTestCase {
function resetCaches() {
drupal_static_reset('locale_url_outbound_alter');
drupal_static_reset('language_list');
drupal_language_initialize();
}
/**
@@ -8,9 +8,9 @@ files[] = i18n_block.inc
files[] = i18n_block.test
; Information added by Drupal.org packaging script on 2015-01-26
version = "7.x-1.12"
; Information added by Drupal.org packaging script on 2016-10-22
version = "7.x-1.14"
core = "7.x"
project = "i18n"
datestamp = "1422286982"
datestamp = "1477154943"
@@ -5,9 +5,9 @@ dependencies[] = i18n_string
package = Multilingual - Internationalization
core = 7.x
; Information added by Drupal.org packaging script on 2015-01-26
version = "7.x-1.12"
; Information added by Drupal.org packaging script on 2016-10-22
version = "7.x-1.14"
core = "7.x"
project = "i18n"
datestamp = "1422286982"
datestamp = "1477154943"
@@ -6,9 +6,9 @@ package = Multilingual - Internationalization
core = 7.x
files[] = i18n_field.inc
files[] = i18n_field.test
; Information added by Drupal.org packaging script on 2015-01-26
version = "7.x-1.12"
; Information added by Drupal.org packaging script on 2016-10-22
version = "7.x-1.14"
core = "7.x"
project = "i18n"
datestamp = "1422286982"
datestamp = "1477154943"
@@ -7,9 +7,9 @@ package = Multilingual - Internationalization
core = 7.x
files[] = i18n_forum.test
; Information added by Drupal.org packaging script on 2015-01-26
version = "7.x-1.12"
; Information added by Drupal.org packaging script on 2016-10-22
version = "7.x-1.14"
core = "7.x"
project = "i18n"
datestamp = "1422286982"
datestamp = "1477154943"
@@ -10,9 +10,9 @@ core = 7.x
files[] = i18n_menu.inc
files[] = i18n_menu.test
; Information added by Drupal.org packaging script on 2015-01-26
version = "7.x-1.12"
; Information added by Drupal.org packaging script on 2016-10-22
version = "7.x-1.14"
core = "7.x"
project = "i18n"
datestamp = "1422286982"
datestamp = "1477154943"
@@ -180,6 +180,7 @@ function i18n_menu_menu_link_alter(&$item) {
// We just make sure every link has a valid language property.
if (!i18n_object_langcode($item)) {
$item['language'] = LANGUAGE_NONE;
$item['i18n_tsid'] = 0;
}
}
@@ -515,9 +516,11 @@ function _i18n_menu_link_description($link, $langcode = NULL) {
* Check whether this link is to be processed by i18n_menu and start processing.
*/
function _i18n_menu_link_process(&$link) {
// Only visible links that have a language property and haven't been processed
// before. We also check that they belong to a menu with language options.
if (empty($link['i18n_menu']) && !empty($link['language']) && !empty($link['access']) && empty($link['hidden']) && i18n_menu_mode($link['menu_name'])) {
// Only links that have a language property and haven't been processed before.
// We also translate links marked as hidden because core breadcrumbs ignore
// that flag and excluding them would basically interfere with core behaviour.
// We also check that they belong to a menu with language options.
if (empty($link['i18n_menu']) && !empty($link['language']) && !empty($link['access']) && i18n_menu_mode($link['menu_name'])) {
// Mark so it won't be processed twice.
$link['i18n_menu'] = TRUE;
// Skip if administering this menu or this menu item.
@@ -588,7 +591,7 @@ function _i18n_menu_link_localizable_properties($link) {
// If the title callback is 't' and the link title matches the router title
// it will be localized by core, not by i18n_menu.
if (!$router ||
(empty($router['title_callback']) || $router['title_callback'] != 't') ||
(empty($router['title_callback']) || ($router['title_callback'] != 't' || !empty($link['customized']))) ||
(empty($router['title']) || $router['title'] != $link['link_title'])
) {
$props[] = 'title';
@@ -597,7 +600,7 @@ function _i18n_menu_link_localizable_properties($link) {
if (!empty($link['options']['attributes']['title'])) {
// If the description matches the router description, it will be localized
// by core.
if (!$router || empty($router['description']) || $router['description'] != $link['options']['attributes']['title']) {
if (!$router || empty($router['description']) || ($router['description'] != $link['options']['attributes']['title']) || !empty($link['customized'])) {
$props[] = 'description';
}
}
@@ -9,9 +9,9 @@ configure = admin/config/regional/i18n/node
files[]=i18n_node.test
files[]=i18n_node.variable.inc
; Information added by Drupal.org packaging script on 2015-01-26
version = "7.x-1.12"
; Information added by Drupal.org packaging script on 2016-10-22
version = "7.x-1.14"
core = "7.x"
project = "i18n"
datestamp = "1422286982"
datestamp = "1477154943"
@@ -6,9 +6,9 @@ core = 7.x
files[] = i18n_path.inc
files[] = i18n_path.test
; Information added by Drupal.org packaging script on 2015-01-26
version = "7.x-1.12"
; Information added by Drupal.org packaging script on 2016-10-22
version = "7.x-1.14"
core = "7.x"
project = "i18n"
datestamp = "1422286982"
datestamp = "1477154943"
@@ -4,9 +4,9 @@ dependencies[] = i18n
package = Multilingual - Internationalization
core = 7.x
; Information added by Drupal.org packaging script on 2015-01-26
version = "7.x-1.12"
; Information added by Drupal.org packaging script on 2016-10-22
version = "7.x-1.14"
core = "7.x"
project = "i18n"
datestamp = "1422286982"
datestamp = "1477154943"
@@ -6,9 +6,9 @@ core = 7.x
configure = admin/config/regional/i18n/select
files[] = i18n_select.test
; Information added by Drupal.org packaging script on 2015-01-26
version = "7.x-1.12"
; Information added by Drupal.org packaging script on 2016-10-22
version = "7.x-1.14"
core = "7.x"
project = "i18n"
datestamp = "1422286982"
datestamp = "1477154943"
@@ -82,11 +82,11 @@ function i18n_select_mode($type = NULL) {
}
/**
* Check current path to enable selection
* Check current path to enable selection.
*
* This works pretty much like block visibility
* This works pretty much like block visibility.
*
* @return boolean
* @return bool
* TRUE if content selection should be enabled for this page.
*/
function i18n_select_page() {
@@ -100,8 +100,11 @@ function i18n_select_page() {
// with different case. Ex: /Page, /page, /PAGE.
$pages = drupal_strtolower($pages);
if ($visibility < I18N_SELECT_PAGE_PHP) {
// Convert the Drupal path to lowercase
$path = drupal_strtolower(drupal_get_path_alias($_GET['q']));
// @see views_ajax()
// @see I18NSelectAdminViewsAjax::testViewsAjaxWithoutSkippingTags()
$path = isset($_REQUEST['view_path']) ? $_REQUEST['view_path'] : $_GET['q'];
// Convert the Drupal path to lowercase.
$path = drupal_strtolower(drupal_get_path_alias($path));
// Compare the lowercase internal and lowercase path alias (if any).
$page_match = drupal_match_path($path, $pages);
if ($path != $_GET['q']) {
@@ -109,8 +112,8 @@ function i18n_select_page() {
}
// When $visibility has a value of 0 (I18N_SELECT_PAGE_NOTLISTED),
// the block is displayed on all pages except those listed in $pages.
// When set to 1 (I18N_SELECT_PAGE_LISTED), it is displayed only on those
// pages listed in $pages.
// When set to 1 (I18N_SELECT_PAGE_LISTED), it is displayed only on
// those pages listed in $pages.
$mode = !($visibility xor $page_match);
}
elseif (module_exists('php')) {
@@ -121,7 +124,7 @@ function i18n_select_page() {
}
}
else {
// No pages defined, still respect the setting (unlike blocks)
// No pages defined, still respect the setting (unlike blocks).
$mode = $visibility == I18N_SELECT_PAGE_NOTLISTED;
}
}
@@ -84,3 +84,87 @@ class i18nSelectTestCase extends Drupali18nTestCase {
}
}
}
/**
* Test case for AJAX queries on "views/ajax" when view on admin page.
*/
class I18NSelectAdminViewsAjax extends Drupali18nTestCase {
/**
* {@inheritdoc}
*/
public static function getInfo() {
return array(
'name' => t('I18N select Admin Views (AJAX)'),
'group' => 'Internationalization',
'description' => t('Test AJAX requests to the "views/ajax" when view located on "admin/*" and list of skipping tags is empty.'),
// Skip this test when "admin_views" module does not exists.
'dependencies' => array('admin_views'),
);
}
/**
* {@inheritdoc}
*/
protected function setUp() {
parent::setUp('translation', 'i18n_variable', 'i18n_select', 'admin_views');
parent::setUpLanguages(array('access content overview'));
parent::setUpContentTranslation();
}
/**
* Test AJAX of a view without skipping tags for selection.
*
* @see i18n_select_page()
*/
public function testViewsAjaxWithoutSkippingTags() {
// If this variable will have the "views" value then this test will not
// have sense. For instance, we want apply language selection filter
// for views and remove "views" from "i18n_select_skip_tags" variable.
// In this case all AJAX for views, on administration part of the site,
// will be broken because the "i18n_select_page()" function will work
// with "views/ajax" path instead of, for example, "admin/content".
variable_set('i18n_select_skip_tags', '');
// Create one hundred of nodes.
for ($i = 1; $i <= 100; $i++) {
// Create every second node on Spanish language and
// every first - on English.
$node = $this->createNode('page', "Node $i", '', $i % 2 ? $this->default_language : $this->secondary_language);
// Update "changed" in order to sort the content by updating date. In
// other case all nodes will be with the same date and not arranged in
// order.
db_update('node')
->fields(array('changed' => strtotime("+ $i minute")))
->condition('nid', $node->nid)
->execute();
}
$this->drupalGet('admin/content');
// Check that latest node exists at the top.
$this->assertText('Node 100');
// Check that our page contains fifty nodes (the latest must be 51).
$this->assertNoText('Node 50');
// Test $_REQUEST['view_path']. There's no form to submit to, so
// drupalPost() won't work here. This just tests a direct $_POST
// request instead.
$this->curlExec(array(
CURLOPT_URL => $this->getAbsoluteUrl('views/ajax'),
CURLOPT_POST => TRUE,
CURLOPT_POSTFIELDS => http_build_query(array(
'page' => 1,
'view_path' => 'admin/content',
'view_name' => 'admin_views_node',
'view_display_id' => 'system_1',
)),
));
// Check that we are successfully switched to a new page of content.
$this->assertText('Node 50');
$this->assertNoText('Node 100');
}
}
@@ -10,9 +10,9 @@ files[] = i18n_string.inc
files[] = i18n_string.test
configure = admin/config/regional/i18n/strings
; Information added by Drupal.org packaging script on 2015-01-26
version = "7.x-1.12"
; Information added by Drupal.org packaging script on 2016-10-22
version = "7.x-1.14"
core = "7.x"
project = "i18n"
datestamp = "1422286982"
datestamp = "1477154943"
@@ -29,7 +29,9 @@ function i18n_string_install() {
i18n_string_update_7001();
}
// Create new index in {locales_source}, performance improvement in sites with i18n.
db_add_index('locales_source', 'textgroup_context', array('textgroup', 'context'));
if (!db_index_exists('locales_source', 'textgroup_context')) {
db_add_index('locales_source', 'textgroup_context', array('textgroup', array('context', 50)));
}
}
/**
@@ -106,7 +108,7 @@ function i18n_string_schema() {
),
'primary key' => array('lid'),
'indexes' => array(
'group_context' => array('textgroup', 'context'),
'group_context' => array('textgroup', array('context', 50)),
),
);
return $schema;
@@ -238,7 +240,9 @@ function i18n_string_update_7001() {
* Create new index in {locales_source}, performance improvement in sites with i18n.
*/
function i18n_string_update_7002() {
db_add_index('locales_source', 'textgroup_context', array('textgroup', 'context'));
if (!db_index_exists('locales_source', 'textgroup_context')) {
db_add_index('locales_source', 'textgroup_context', array('textgroup', array('context', 50)));
}
}
@@ -269,4 +273,4 @@ function i18n_string_update_7002() {
* Node type
* nodetype:type:[type]:[property] -> node:type:[type]:[property]
* Property names: title -> title_label
*/
*/
@@ -53,6 +53,28 @@ class i18nStringTestCase extends Drupali18nTestCase {
$this->assertEqual($translation, $translations[$key][$language->language], "The right $language->name ($language->language) translation has been retrieved for $name, $translation");
}
}
// Test that regular strings can be translated. Use 'Built-in interface' as
// filter, and translate first one.
$search = array(
'language' => 'all',
'translation' => 'all',
'group' => 'default',
'string' => '',
);
$this->drupalPost('admin/config/regional/translate/translate', $search, t('Filter'));
$this->clickLink(t('edit'));
// Just add a random translation.
$translation = $this->randomString();
$edit = array();
foreach ($this->getOtherLanguages() as $language) {
$langcode = $language->language;
$edit["translations[$langcode]"] = $translation;
}
$this->drupalPost(NULL, $edit, t('Save translations'));
$this->assertText(t('The string has been saved.'), t('The string has been saved.'));
$this->assertEqual($this->getUrl(), url('admin/config/regional/translate/translate', array('absolute' => TRUE)), t('Correct page redirection.'));
}
/**
@@ -10,9 +10,9 @@ files[] = i18n_sync.install
files[] = i18n_sync.module.inc
files[] = i18n_sync.node.inc
files[] = i18n_sync.test
; Information added by Drupal.org packaging script on 2015-01-26
version = "7.x-1.12"
; Information added by Drupal.org packaging script on 2016-10-22
version = "7.x-1.14"
core = "7.x"
project = "i18n"
datestamp = "1422286982"
datestamp = "1477154943"
@@ -11,9 +11,9 @@ files[] = i18n_taxonomy.pages.inc
files[] = i18n_taxonomy.admin.inc
files[] = i18n_taxonomy.test
; Information added by Drupal.org packaging script on 2015-01-26
version = "7.x-1.12"
; Information added by Drupal.org packaging script on 2016-10-22
version = "7.x-1.14"
core = "7.x"
project = "i18n"
datestamp = "1422286982"
datestamp = "1477154943"
@@ -213,7 +213,12 @@ function i18n_taxonomy_field_formatter_view($entity_type, $entity, $field, $inst
);
}
else {
$term = $item['taxonomy_term'];
if (isset($item['taxonomy_term'])) {
$term = $item['taxonomy_term'];
}
else {
$term = taxonomy_term_load($item['tid']);
}
$uri = entity_uri('taxonomy_term', $term);
$element[$delta] = array(
'#type' => 'link',
@@ -1020,6 +1025,10 @@ function i18n_taxonomy_localize_terms($terms) {
if (!i18n_string_translate_langcode()) {
return $terms;
}
// $terms is not a valid array or term.
if (empty($terms)) {
return $terms;
}
$object_info = i18n_object_info('taxonomy_term');
$list = is_array($terms) ? $terms : array($terms);
foreach ($list as $index => $term) {
@@ -6,9 +6,9 @@ core = 7.x
files[] = i18n_translation.inc
; Information added by Drupal.org packaging script on 2015-01-26
version = "7.x-1.12"
; Information added by Drupal.org packaging script on 2016-10-22
version = "7.x-1.14"
core = "7.x"
project = "i18n"
datestamp = "1422286982"
datestamp = "1477154943"
@@ -4,9 +4,9 @@ core = 7.x
package = Multilingual - Internationalization
dependencies[] = i18n_variable
; Information added by Drupal.org packaging script on 2015-01-26
version = "7.x-1.12"
; Information added by Drupal.org packaging script on 2016-10-22
version = "7.x-1.14"
core = "7.x"
project = "i18n"
datestamp = "1422286982"
datestamp = "1477154943"
@@ -54,7 +54,7 @@ function i18n_user_user_mail_tokens(&$replacements, $data, $options) {
*/
function i18n_user_user_pass_reset_url($account) {
$timestamp = REQUEST_TIME;
return url("user/reset/$account->uid/$timestamp/" . user_pass_rehash($account->pass, $timestamp, $account->login), array('absolute' => TRUE, 'language' => i18n_language($account->language)));
return url("user/reset/$account->uid/$timestamp/" . user_pass_rehash($account->pass, $timestamp, $account->login, $account->uid), array('absolute' => TRUE, 'language' => i18n_language($account->language)));
}
/**
@@ -65,5 +65,5 @@ function i18n_user_user_pass_reset_url($account) {
*/
function i18n_user_user_cancel_url($account) {
$timestamp = REQUEST_TIME;
return url("user/$account->uid/cancel/confirm/$timestamp/" . user_pass_rehash($account->pass, $timestamp, $account->login), array('absolute' => TRUE, 'language' => i18n_language($account->language)));
return url("user/$account->uid/cancel/confirm/$timestamp/" . user_pass_rehash($account->pass, $timestamp, $account->login, $account->uid), array('absolute' => TRUE, 'language' => i18n_language($account->language)));
}
@@ -10,9 +10,9 @@ configure = admin/config/regional/i18n/variable
files[] = i18n_variable.class.inc
files[] = i18n_variable.test
; Information added by Drupal.org packaging script on 2015-01-26
version = "7.x-1.12"
; Information added by Drupal.org packaging script on 2016-10-22
version = "7.x-1.14"
core = "7.x"
project = "i18n"
datestamp = "1422286982"
datestamp = "1477154943"
@@ -7,9 +7,9 @@ package = Testing
core = 6.x
hidden = TRUE
; Information added by Drupal.org packaging script on 2015-01-26
version = "7.x-1.12"
; Information added by Drupal.org packaging script on 2016-10-22
version = "7.x-1.14"
core = "7.x"
project = "i18n"
datestamp = "1422286982"
datestamp = "1477154943"