Updated to Drupal 8.6.4, which is PHP 7.3 friendly. Also updated HTMLaw library....
[yaffs-website] / web / core / modules / locale / locale.bulk.inc
index 3e256c28fd1cb71c1b5dfde301f3e0d5d761a49a..69b465b4ae1939efb997c4486abe4b2b4855f065 100644 (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,
         ];
@@ -372,7 +372,7 @@ function locale_translate_batch_finished($success, array $results) {
       else {
         $message = \Drupal::translation()->formatPlural(count($results['failed_files']), 'One translation file could not be imported. See the log for details.', '@count translation files could not be imported. See the log for details.');
       }
-      drupal_set_message($message, 'error');
+      \Drupal::messenger()->addError($message);
     }
     if (isset($results['files'])) {
       $skipped_files = [];
@@ -389,7 +389,7 @@ function locale_translate_batch_finished($success, array $results) {
           }
         }
       }
-      drupal_set_message(\Drupal::translation()->formatPlural(count($results['files']),
+      \Drupal::messenger()->addStatus(\Drupal::translation()->formatPlural(count($results['files']),
         'One translation file imported. %number translations were added, %update translations were updated and %delete translations were removed.',
         '@count translation files imported. %number translations were added, %update translations were updated and %delete translations were removed.',
         ['%number' => $additions, '%update' => $updates, '%delete' => $deletes]
@@ -403,7 +403,7 @@ function locale_translate_batch_finished($success, array $results) {
         else {
           $message = \Drupal::translation()->formatPlural($skips, 'One translation string was skipped because of disallowed or malformed HTML. See the log for details.', '@count translation strings were skipped because of disallowed or malformed HTML. See the log for details.');
         }
-        drupal_set_message($message, 'warning');
+        \Drupal::messenger()->addWarning($message);
         $logger->warning('@count disallowed HTML string(s) in files: @files.', ['@count' => $skips, '@files' => implode(',', $skipped_files)]);
       }
     }
@@ -630,11 +630,11 @@ function locale_config_batch_finished($success, array $results) {
   if ($success) {
     $configuration = isset($results['stats']['config']) ? $results['stats']['config'] : 0;
     if ($configuration) {
-      drupal_set_message(t('The configuration was successfully updated. There are %number configuration objects updated.', ['%number' => $configuration]));
+      \Drupal::messenger()->addStatus(t('The configuration was successfully updated. There are %number configuration objects updated.', ['%number' => $configuration]));
       \Drupal::logger('locale')->notice('The configuration was successfully updated. %number configuration objects updated.', ['%number' => $configuration]);
     }
     else {
-      drupal_set_message(t('No configuration objects have been updated.'));
+      \Drupal::messenger()->addStatus(t('No configuration objects have been updated.'));
       \Drupal::logger('locale')->warning('No configuration objects have been updated.');
     }
   }