You are here

public function OpenlayersMapListBuilder::getDefaultOperations in Openlayers 8.4

This function is a workaround until the core issue (#2950883)) is resolved - https://www.drupal.org/project/drupal/issues/2950883

Overrides ConfigEntityListBuilder::getDefaultOperations

File

src/Controller/OpenlayersMapListBuilder.php, line 38

Class

OpenlayersMapListBuilder
Provides a listing of Openalyers Map configuration entities.

Namespace

Drupal\openlayers\Controller

Code

public function getDefaultOperations(EntityInterface $entity) {
  $operations = parent::getDefaultOperations($entity);

  // Remove destination URL from the edit link to allow editing of map layers.
  if (isset($operations['edit'])) {
    $operations['edit']['url'] = $entity
      ->toUrl('edit-form');
  }
  return $operations;
}