updated core from 8.4 to 8.5 : bug with login_destination

This commit is contained in:
Bachir Soussi Chiadmi
2018-03-13 14:01:21 +01:00
parent 0d78da249b
commit e668535a4e
3486 changed files with 89604 additions and 33283 deletions
@@ -5,7 +5,7 @@ javascript:
translation:
use_source: remote_and_local
default_filename: '%project-%version.%language.po'
default_server_pattern: 'http://ftp.drupal.org/files/translations/%core/%project/%project-%version.%language.po'
default_server_pattern: 'https://ftp.drupal.org/files/translations/%core/%project/%project-%version.%language.po'
overwrite_customized: false
overwrite_not_customized: true
update_interval_days: 0
+5 -6
View File
@@ -37,7 +37,7 @@
table-layout: fixed;
}
.locale-translate-edit-form td {
vertical-align: top
vertical-align: top;
}
.locale-translate-edit-form tr.changed {
@@ -49,7 +49,7 @@
}
.locale-translate-filter-form .form-wrapper {
margin-bottom:0;
margin-bottom: 0;
}
.locale-translate-edit-form table.changed {
@@ -68,18 +68,16 @@
#locale-translation-status-form th.title {
width: 25%;
}
#locale-translation-status-form th.description {
}
#locale-translation-status-form td {
vertical-align: top;
}
.locale-translation-update__wrapper {
background: transparent url(../../../misc/menu-collapsed.png) left .6em no-repeat;
background: transparent url(../../../misc/menu-collapsed.png) left 0.6em no-repeat;
margin-left: -12px;
padding-left: 12px;
}
.expanded .locale-translation-update__wrapper {
background: transparent url(../../../misc/menu-expanded.png) left .6em no-repeat;
background: transparent url(../../../misc/menu-expanded.png) left 0.6em no-repeat;
}
#locale-translation-status-form .description {
cursor: pointer;
@@ -125,6 +123,7 @@
margin: 0 0 0.25em 1.5em;
padding: 0;
}
@media screen and (max-width: 40em) {
#locale-translation-status-form th.title {
width: 20%;
+1 -1
View File
@@ -23,7 +23,7 @@
.on('change', function () {
// If the filename is fully the language code or the filename
// ends with a language code, pre-select that one.
const matches = $(this).val().match(/([^.][\.]*)([\w-]+)\.po$/);
const matches = $(this).val().match(/([^.][.]*)([\w-]+)\.po$/);
if (matches && $langcode.find(`option[value="${matches[2]}"]`).length) {
$langcode.val(matches[2]);
}
+1 -1
View File
@@ -200,7 +200,7 @@ function locale_translate_batch_import($file, array $options, &$context) {
try {
if (empty($context['sandbox'])) {
$context['sandbox']['parse_state'] = [
'filesize' => filesize(drupal_realpath($file->uri)),
'filesize' => filesize(\Drupal::service('file_system')->realpath($file->uri)),
'chunk_size' => 200,
'seek' => 0,
];
+1 -1
View File
@@ -12,7 +12,7 @@
if ($form.length) {
var $langcode = $form.find('.langcode-input');
$form.find('.file-import-input').on('change', function () {
var matches = $(this).val().match(/([^.][\.]*)([\w-]+)\.po$/);
var matches = $(this).val().match(/([^.][.]*)([\w-]+)\.po$/);
if (matches && $langcode.find('option[value="' + matches[2] + '"]').length) {
$langcode.val(matches[2]);
}
+3 -3
View File
@@ -9,8 +9,8 @@ dependencies:
- language
- file
# Information added by Drupal.org packaging script on 2018-01-03
version: '8.4.4'
# Information added by Drupal.org packaging script on 2018-03-07
version: '8.5.0'
core: '8.x'
project: 'drupal'
datestamp: 1515021228
datestamp: 1520457825
+16 -4
View File
@@ -260,7 +260,7 @@ function locale_requirements($phase) {
if ($available_updates || $untranslated) {
if ($available_updates) {
$requirements['locale_translation'] = [
'title' => 'Translation update status',
'title' => t('Translation update status'),
'value' => \Drupal::l(t('Updates available'), new Url('locale.translate_status')),
'severity' => REQUIREMENT_WARNING,
'description' => t('Updates available for: @languages. See the <a href=":updates">Available translation updates</a> page for more information.', ['@languages' => implode(', ', $available_updates), ':updates' => \Drupal::url('locale.translate_status')]),
@@ -268,7 +268,7 @@ function locale_requirements($phase) {
}
else {
$requirements['locale_translation'] = [
'title' => 'Translation update status',
'title' => t('Translation update status'),
'value' => t('Missing translations'),
'severity' => REQUIREMENT_INFO,
'description' => t('Missing translations for: @languages. See the <a href=":updates">Available translation updates</a> page for more information.', ['@languages' => implode(', ', $untranslated), ':updates' => \Drupal::url('locale.translate_status')]),
@@ -277,7 +277,7 @@ function locale_requirements($phase) {
}
else {
$requirements['locale_translation'] = [
'title' => 'Translation update status',
'title' => t('Translation update status'),
'value' => t('Up to date'),
'severity' => REQUIREMENT_OK,
];
@@ -285,7 +285,7 @@ function locale_requirements($phase) {
}
else {
$requirements['locale_translation'] = [
'title' => 'Translation update status',
'title' => t('Translation update status'),
'value' => \Drupal::l(t('Can not determine status'), new Url('locale.translate_status')),
'severity' => REQUIREMENT_WARNING,
'description' => t('No translation status is available. See the <a href=":updates">Available translation updates</a> page for more information.', [':updates' => \Drupal::url('locale.translate_status')]),
@@ -304,3 +304,15 @@ function locale_update_8300() {
// the new key value collection.
\Drupal::state()->delete('locale.translation_status');
}
/**
* Update default server pattern value to use https.
*/
function locale_update_8500() {
$update_url = \Drupal::config('locale.settings')->get('translation.default_server_pattern');
if ($update_url == 'http://ftp.drupal.org/files/translations/%core/%project/%project-%version.%language.po') {
\Drupal::configFactory()->getEditable('locale.settings')
->set('translation.default_server_pattern', 'https://ftp.drupal.org/files/translations/%core/%project/%project-%version.%language.po')
->save();
}
}
+1 -1
View File
@@ -99,7 +99,7 @@ const LOCALE_TRANSLATION_USE_SOURCE_REMOTE_AND_LOCAL = 'remote_and_local';
*
* @see locale_translation_default_translation_server().
*/
const LOCALE_TRANSLATION_DEFAULT_SERVER_PATTERN = 'http://ftp.drupal.org/files/translations/%core/%project/%project-%version.%language.po';
const LOCALE_TRANSLATION_DEFAULT_SERVER_PATTERN = 'https://ftp.drupal.org/files/translations/%core/%project/%project-%version.%language.po';
/**
* The number of seconds that the translations status entry should be considered.
+6 -1
View File
@@ -13,9 +13,14 @@ use Symfony\Component\HttpFoundation\RedirectResponse;
*
* Manually checks the translation status without the use of cron.
*
* @see locale_menu()
* @deprecated in Drupal 8.5.0 and will be removed before 9.0.0. It is unused by
* Drupal core. Duplicate this function in your own extension if you need its
* behavior.
*
* @see https://www.drupal.org/node/2931188
*/
function locale_translation_manual_status() {
@trigger_error('locale_translation_manual_status() is deprecated in Drupal 8.5.0 and will be removed before Drupal 9.0.0. It is unused by Drupal core. Duplicate this function in your own extension if you need its behavior.', E_USER_DEPRECATED);
module_load_include('compare.inc', 'locale');
// Check the translation status of all translatable projects in all languages.
+1 -1
View File
@@ -377,7 +377,7 @@ function locale_cron_fill_queue() {
function _locale_translation_file_is_remote($uri) {
$scheme = file_uri_scheme($uri);
if ($scheme) {
return !drupal_realpath($scheme . '://');
return !\Drupal::service('file_system')->realpath($scheme . '://');
}
return FALSE;
}
@@ -3,6 +3,7 @@ label: Locale configuration
migration_tags:
- Drupal 6
- Drupal 7
- Configuration
source:
plugin: variable
variables:
@@ -14,6 +14,8 @@ use Symfony\Component\HttpFoundation\BinaryFileResponse;
/**
* Form for the Gettext translation files export form.
*
* @internal
*/
class ExportForm extends FormBase {
+4 -1
View File
@@ -11,6 +11,8 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
/**
* Form constructor for the translation import screen.
*
* @internal
*/
class ImportForm extends FormBase {
@@ -108,6 +110,7 @@ class ImportForm extends FormBase {
],
'#size' => 50,
'#upload_validators' => $validators,
'#upload_location' => 'translations://',
'#attributes' => ['class' => ['file-import-input']],
];
$form['langcode'] = [
@@ -154,7 +157,7 @@ class ImportForm extends FormBase {
* {@inheritdoc}
*/
public function validateForm(array &$form, FormStateInterface $form_state) {
$this->file = file_save_upload('file', $form['file']['#upload_validators'], 'translations://', 0);
$this->file = _file_save_upload_from_form($form['file'], $form_state, 0);
// Ensure we have the file uploaded.
if (!$this->file) {
@@ -7,6 +7,8 @@ use Drupal\Core\Form\FormStateInterface;
/**
* Configure locale settings for this site.
*
* @internal
*/
class LocaleSettingsForm extends ConfigFormBase {
@@ -8,6 +8,8 @@ use Drupal\locale\SourceString;
/**
* Defines a translation edit form.
*
* @internal
*/
class TranslateEditForm extends TranslateFormBase {
@@ -6,6 +6,8 @@ use Drupal\Core\Form\FormStateInterface;
/**
* Provides a filtered translation edit form.
*
* @internal
*/
class TranslateFilterForm extends TranslateFormBase {
@@ -10,6 +10,8 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
/**
* Provides a translation status form.
*
* @internal
*/
class TranslationStatusForm extends FormBase {
@@ -6,8 +6,8 @@ package: Testing
# version: VERSION
# Information added by Drupal.org packaging script on 2018-01-03
version: '8.4.4'
# Information added by Drupal.org packaging script on 2018-03-07
version: '8.5.0'
core: '8.x'
project: 'drupal'
datestamp: 1515021228
datestamp: 1520457825
@@ -8,8 +8,8 @@ hidden: true
'interface translation project': locale_test
'interface translation server pattern': core/modules/locale/test/test.%language.po
# Information added by Drupal.org packaging script on 2018-01-03
version: '8.4.4'
# Information added by Drupal.org packaging script on 2018-03-07
version: '8.5.0'
core: '8.x'
project: 'drupal'
datestamp: 1515021228
datestamp: 1520457825
@@ -6,8 +6,8 @@ package: Testing
# core: 8.x
hidden: true
# Information added by Drupal.org packaging script on 2018-01-03
version: '8.4.4'
# Information added by Drupal.org packaging script on 2018-03-07
version: '8.5.0'
core: '8.x'
project: 'drupal'
datestamp: 1515021228
datestamp: 1520457825
@@ -8,8 +8,8 @@ hidden: true
'interface translation project': locale_test_translate
'interface translation server pattern': core/modules/locale/tests/test.%language.po
# Information added by Drupal.org packaging script on 2018-01-03
version: '8.4.4'
# Information added by Drupal.org packaging script on 2018-03-07
version: '8.5.0'
core: '8.x'
project: 'drupal'
datestamp: 1515021228
datestamp: 1520457825
@@ -20,6 +20,18 @@ class LocaleConfigTranslationImportTest extends BrowserTestBase {
*/
public static $modules = ['language', 'locale_test_translate'];
/**
* {@inheritdoc}
*/
protected function setUp() {
parent::setUp();
// @todo Re-enable the test and only skip it when the translation cannot be
// downloaded, or provide a translation as a fixture instead. See
// https://www.drupal.org/project/drupal/issues/2828143.
$this->markTestSkipped();
}
/**
* Test update changes configuration translations if enabled after language.
*/
@@ -231,7 +231,7 @@ class LocaleConfigTranslationTest extends BrowserTestBase {
}
// Check the optional default configuration in node module.
$string = $this->storage->findString(['source' => 'No front page content has been created yet.', 'context' => '', 'type' => 'configuration']);
$string = $this->storage->findString(['source' => 'No front page content has been created yet.<br/>Follow the <a target="_blank" href="https://www.drupal.org/docs/user_guide/en/index.html">User Guide</a> to start building your site.', 'context' => '', 'type' => 'configuration']);
if ($optional) {
$this->assertFalse($this->config('views.view.frontpage')->isNew());
$this->assertTrue($string, 'Node view text can be found with node and views modules.');
@@ -138,7 +138,7 @@ EOF;
'status' => FILE_STATUS_PERMANENT,
]);
file_put_contents($file->getFileUri(), $po_header . $text);
touch(drupal_realpath($file->getFileUri()), $timestamp);
touch(\Drupal::service('file_system')->realpath($file->getFileUri()), $timestamp);
$file->save();
}
@@ -47,7 +47,7 @@ class LocaleUpdateCronTest extends LocaleUpdateBase {
// Prepare for test: Simulate new translations being available.
// Change the last updated timestamp of a translation file.
$contrib_module_two_uri = 'public://local/contrib_module_two-8.x-2.0-beta4.de._po';
touch(drupal_realpath($contrib_module_two_uri), REQUEST_TIME);
touch(\Drupal::service('file_system')->realpath($contrib_module_two_uri), REQUEST_TIME);
// Prepare for test: Simulate that the file has not been checked for a long
// time. Set the last_check timestamp to zero.
@@ -0,0 +1,30 @@
<?php
namespace Drupal\Tests\locale\Kernel;
use Drupal\KernelTests\KernelTestBase;
/**
* Tests deprecations in the locale module.
*
* @group locale
* @group legacy
*/
class LocaleDeprecationsTest extends KernelTestBase {
/**
* Modules to enable.
*
* @var array
*/
public static $modules = ['locale', 'system'];
/**
* @expectedDeprecation locale_translation_manual_status() is deprecated in Drupal 8.5.0 and will be removed before Drupal 9.0.0. It is unused by Drupal core. Duplicate this function in your own extension if you need its behavior.
*/
public function testLocaleTranslationManualStatusDeprecation() {
module_load_include('pages.inc', 'locale');
$this->assertNotNull(\locale_translation_manual_status());
}
}