Skip to content
Snippets Groups Projects

set redirect from block edit to collection instead of self in more cases

2 files
+ 37
26
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -108,20 +108,18 @@ public function save(array $form, FormStateInterface $form_state) {
if ($block->id()) {
$form_state->setValue('id', $block->id());
$form_state->set('id', $block->id());
if ($insert) {
$theme = $block->getTheme();
if ($theme) {
$form_state->setRedirect(
'block.admin_add',
[
'plugin_id' => 'block_content:' . $block->uuid(),
'theme' => $theme,
]
);
}
else {
$form_state->setRedirectUrl($block->toUrl('collection'));
}
$theme = $block->getTheme();
if ($insert && $theme) {
$form_state->setRedirect(
'block.admin_add',
[
'plugin_id' => 'block_content:' . $block->uuid(),
'theme' => $theme,
]
);
}
else {
$form_state->setRedirectUrl($block->toUrl('collection'));
}
}
else {
Loading