Redirecting to home page after deleting organisation
This commit is contained in:
parent
0caf2cb7c8
commit
3aa4fbc5cf
@ -117,8 +117,8 @@ function opencase_entity_field_access($operation, \Drupal\Core\Field\FieldDefini
|
||||
* Changes what page is redirected to after deleting things
|
||||
*/
|
||||
function opencase_form_alter(&$form, &$form_state, $form_id) {
|
||||
if (preg_match('/oc_actor_.*_delete_form/', $form_id) or (preg_match('/oc_case_.*_delete_form/', $form_id))) {
|
||||
$form['actions']['submit']['#submit'][] = '_opencase_delete_case_redirect';
|
||||
if (preg_match('/oc_actor_.*_delete_form/', $form_id) or (preg_match('/oc_case_.*_delete_form/', $form_id)) or (preg_match('/oc_organisation_.*_delete_form/', $form_id))) {
|
||||
$form['actions']['submit']['#submit'][] = '_opencase_redirect_to_home';
|
||||
$form['actions']['cancel']['#url'] = $form_state->getFormObject()->getEntity()->toUrl();
|
||||
}
|
||||
if (preg_match('/oc_activity_.*_delete_form/', $form_id)) {
|
||||
@ -127,7 +127,7 @@ function opencase_form_alter(&$form, &$form_state, $form_id) {
|
||||
}
|
||||
}
|
||||
|
||||
function _opencase_delete_case_redirect($form, &$form_state) {
|
||||
function _opencase_redirect_to_home($form, &$form_state) {
|
||||
$form_state->setRedirect('<front>');
|
||||
}
|
||||
function _opencase_delete_activity_redirect($form, &$form_state) {
|
||||
|
Reference in New Issue
Block a user