projects
/
yaffs-website
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Updated to Drupal 8.6.4, which is PHP 7.3 friendly. Also updated HTMLaw library....
[yaffs-website]
/
web
/
core
/
modules
/
locale
/
src
/
Form
/
ImportForm.php
diff --git
a/web/core/modules/locale/src/Form/ImportForm.php
b/web/core/modules/locale/src/Form/ImportForm.php
index 40a77204b47d373a52819a816429b8d55ee64840..122093ae69d216379b9aa8814900f634354a6c33 100644
(file)
--- a/
web/core/modules/locale/src/Form/ImportForm.php
+++ b/
web/core/modules/locale/src/Form/ImportForm.php
@@
-11,6
+11,8
@@
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
* Form constructor for the translation import screen.
/**
* Form constructor for the translation import screen.
+ *
+ * @internal
*/
class ImportForm extends FormBase {
*/
class ImportForm extends FormBase {
@@
-44,6
+46,7
@@
class ImportForm extends FormBase {
$container->get('language_manager')
);
}
$container->get('language_manager')
);
}
+
/**
* Constructs a form for language import.
*
/**
* Constructs a form for language import.
*
@@
-108,6
+111,7
@@
class ImportForm extends FormBase {
],
'#size' => 50,
'#upload_validators' => $validators,
],
'#size' => 50,
'#upload_validators' => $validators,
+ '#upload_location' => 'translations://',
'#attributes' => ['class' => ['file-import-input']],
];
$form['langcode'] = [
'#attributes' => ['class' => ['file-import-input']],
];
$form['langcode'] = [
@@
-154,7
+158,7
@@
class ImportForm extends FormBase {
* {@inheritdoc}
*/
public function validateForm(array &$form, FormStateInterface $form_state) {
* {@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) {
// Ensure we have the file uploaded.
if (!$this->file) {
@@
-172,7
+176,7
@@
class ImportForm extends FormBase {
if (empty($language)) {
$language = ConfigurableLanguage::createFromLangcode($form_state->getValue('langcode'));
$language->save();
if (empty($language)) {
$language = ConfigurableLanguage::createFromLangcode($form_state->getValue('langcode'));
$language->save();
-
drupal_set_message
($this->t('The language %language has been created.', ['%language' => $this->t($language->label())]));
+
$this->messenger()->addStatus
($this->t('The language %language has been created.', ['%language' => $this->t($language->label())]));
}
$options = array_merge(_locale_translation_default_update_options(), [
'langcode' => $form_state->getValue('langcode'),
}
$options = array_merge(_locale_translation_default_update_options(), [
'langcode' => $form_state->getValue('langcode'),