Skip to content

Commit

Permalink
Don't overwrite explicitly provided action link config.
Browse files Browse the repository at this point in the history
Before this fix you always ended up with table scope for mapped IndexAction
even if you explicitly set scope to entity in action link config.
  • Loading branch information
ADmad committed Apr 3, 2018
1 parent 42aedce commit 364a991
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/Listener/ViewListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -421,14 +421,13 @@ protected function _getControllerActionConfiguration($actionName, $config)
$action = $this->_action($realAction);
$class = get_class($action);
$class = substr($class, strrpos($class, '\\') + 1);
$config['scope'] = $action->scope();

if ($class === 'DeleteAction') {
$config['method'] = 'DELETE';
$config += ['method' => 'DELETE'];
}

if ($class === 'AddAction') {
$config['scope'] = 'table';
if (!isset($config['scope'])) {
$config['scope'] = $class === 'AddAction' ? 'table' : $action->scope();
}
}

Expand Down

0 comments on commit 364a991

Please sign in to comment.