To set slider images permanent

Created on 6 August 2024, 5 months ago
Updated 8 August 2024, 5 months ago

Problem/Motivation

Normally files for slides are set as temporary, this means whenever cron runs they are removed and site fails.

Steps to reproduce

Do as above

Proposed resolution

Add this in restaurant_zymphonies_theme.theme as there already is a hook to the below (which also makes it crash if not avaliable)

function restaurant_zymphonies_theme_settings_form_submit(array &$form, \Drupal\Core\Form\FormStateInterface $form_state) {
  for ($i = 1; $i <= theme_get_setting('no_of_slides','restaurant_zymphonies_theme'); $i++) {
                $form_file = theme_get_setting('slide_image_path'.$i,'restaurant_zymphonies_theme');
                $file = File::load($form_file[0]);
                $file->setPermanent();
                $file->save();
        }
}

Remaining tasks

User interface changes

API changes

Data model changes

๐Ÿ› Bug report
Status

Needs review

Version

3.0

Component

Code

Created by

๐Ÿ‡ธ๐Ÿ‡ชSweden arne_hortell

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024