You are here

function socialblue_save_email_logo in Open Social 8.9

Same name and namespace in other branches
  1. 8.4 themes/socialblue/theme-settings.php \socialblue_save_email_logo()
  2. 8.5 themes/socialblue/theme-settings.php \socialblue_save_email_logo()
  3. 8.6 themes/socialblue/theme-settings.php \socialblue_save_email_logo()
  4. 8.7 themes/socialblue/theme-settings.php \socialblue_save_email_logo()
  5. 8.8 themes/socialblue/theme-settings.php \socialblue_save_email_logo()

Marks the e-mail logo file as permanent.

This ensures the image is not cleaned up by Drupal's temporary file cleaning.

Parameters

array $form: The submitted form structure.

\Drupal\Core\Form\FormStateInterface $form_state: The state of the submitted form.

Throws

\Drupal\Core\Entity\EntityStorageException

1 string reference to 'socialblue_save_email_logo'
socialblue_form_system_theme_settings_alter in themes/socialblue/theme-settings.php
Implements hook_form_FORM_ID_alter().

File

themes/socialblue/theme-settings.php, line 227
Allows users to change the color scheme of themes.

Code

function socialblue_save_email_logo(array $form, FormStateInterface $form_state) {
  $email_logo = $form_state
    ->getValue('email_logo');

  // If an e-mail logo was uploaded then we mark the uploaded file as permanent.
  if (!empty($email_logo)) {
    $file = File::load($email_logo[0]);
    $file
      ->setPermanent();
    $file
      ->save();
  }
}