You are here

function lightning_workflow_update_8004 in Lightning Workflow 8.2

Same name and namespace in other branches
  1. 8.3 lightning_workflow.install \lightning_workflow_update_8004()
  2. 8 lightning_workflow.install \lightning_workflow_update_8004()

Removes the latest_revision__node relationship from the content view.

File

./lightning_workflow.install, line 93
Contains installation and update routines for Lightning Workflow.

Code

function lightning_workflow_update_8004() {
  $config = \Drupal::configFactory()
    ->getEditable('views.view.content');
  if ($config
    ->isNew()) {
    return;
  }
  foreach (array_keys($config
    ->get('display')) as $display_id) {
    $config
      ->clear("display.{$display_id}.display_options.relationships.latest_revision__node");
    $config
      ->clear("display.{$display_id}.display_options.fields.forward_revision_exists");
  }
  $config
    ->save();
}