You are here

function entityqueue_post_update_remove_reverse_in_admin_setting in Entityqueue 8

Remove the obsolete 'reverse_in_admin' queue setting.

File

./entityqueue.post_update.php, line 100
Post update functions for Entityqueue.

Code

function entityqueue_post_update_remove_reverse_in_admin_setting() {
  $config_factory = \Drupal::configFactory();

  // Iterate on all queues.
  foreach ($config_factory
    ->listAll('entityqueue.entity_queue.') as $queue_id) {
    $queue_config = $config_factory
      ->getEditable($queue_id);
    $queue_settings = $queue_config
      ->get('queue_settings');
    unset($queue_settings['reverse_in_admin']);
    $queue_settings['reverse'] = FALSE;
    $queue_config
      ->set('queue_settings', $queue_settings);
    $queue_config
      ->save(TRUE);
  }
}