Cannot redeclare gin_lb_update_8003()

Created on 3 April 2023, about 1 year ago
Updated 3 May 2023, about 1 year ago

When trying to uninstall gin_lb, an error is thrown:

Cannot redeclare gin_lb_update_8003()

The function gin_lb_update_8003 is indeed declared twice.
Both functions appear to do similar things


/**
 * Rename save_behavior variable and hide_discard_revert_buttons.
 */
function gin_lb_update_8003() {
  $config_factory = \Drupal::configFactory();
  $config = $config_factory->getEditable('gin_lb.settings');
  $toastify_loading = $config->get('toastify_cdn') ? 'cdn' : 'custom';
  $config->set('toastify_loading', $toastify_loading);
  $config->set('safe_behavior', NULL);
  $config->set('save_behavior', 'stay');
  $hide_discard_revert_buttons = $config->get('hide_discard_revert_buttons') ?? TRUE;
  $config->set('hide_discard_revert_buttons', $hide_discard_revert_buttons);
  $config->save(TRUE);
}

/**
 * Rename save_behavior variable.
 */
function gin_lb_update_8003() {
  $config_factory = \Drupal::configFactory();
  $config = $config_factory->getEditable('gin_lb.settings');
  $toastify_loading = $config->get('toastify_cdn') ? 'cdn' : 'custom';
  $config->set('toastify_loading', $toastify_loading);
  $config->set('safe_behavior', NULL);
  $config->set('save_behavior', 'stay');
  $config->save(TRUE);
}

I think we should either rename the last function to gin_lb_update_8004, or remove it all together as the first one already covers the same thing

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇧🇪Belgium svdhout

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

Comments & Activities

Production build 0.69.0 2024