diff --git a/core/lib/Drupal/Core/Entity/EntityFormController.php b/core/lib/Drupal/Core/Entity/EntityFormController.php index 2ea0fbe..0862184 100644 --- a/core/lib/Drupal/Core/Entity/EntityFormController.php +++ b/core/lib/Drupal/Core/Entity/EntityFormController.php @@ -246,6 +246,9 @@ protected function actions(array $form, array &$form_state) { ), 'delete' => array( '#value' => $this->t('Delete'), + '#ajax' => array( + 'accepts' => 'application/vnd.drupal-modal', + ), // No need to validate the form when deleting the entity. '#submit' => array( array($this, 'delete'), diff --git a/core/lib/Drupal/Core/Entity/EntityListController.php b/core/lib/Drupal/Core/Entity/EntityListController.php index fdbc6a9..8c2e5e9 100644 --- a/core/lib/Drupal/Core/Entity/EntityListController.php +++ b/core/lib/Drupal/Core/Entity/EntityListController.php @@ -127,6 +127,9 @@ public function getOperations(EntityInterface $entity) { $operations['delete'] = array( 'title' => $this->t('Delete'), 'href' => $uri['path'] . '/delete', + 'ajax' => array( + 'accepts' => 'application/vnd.drupal-modal', + ), 'options' => $uri['options'], 'weight' => 100, ); diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Controller/AggregatorController.php b/core/modules/aggregator/lib/Drupal/aggregator/Controller/AggregatorController.php index f9b25b9..de07cec 100644 --- a/core/modules/aggregator/lib/Drupal/aggregator/Controller/AggregatorController.php +++ b/core/modules/aggregator/lib/Drupal/aggregator/Controller/AggregatorController.php @@ -155,11 +155,17 @@ public function adminOverview() { 'title' => $this->t('Delete'), 'route_name' => 'aggregator.feed_delete', 'route_parameters' => array('aggregator_feed' => $feed->fid), + 'ajax' => array( + 'accepts' => 'application/vnd.drupal-modal', + ), ); $links['remove'] = array( 'title' => $this->t('Remove items'), 'route_name' => 'aggregator.feed_items_delete', 'route_parameters' => array('aggregator_feed' => $feed->fid), + 'ajax' => array( + 'accepts' => 'application/vnd.drupal-modal', + ), ); $links['update'] = array( 'title' => $this->t('Update items'), diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigEntityListTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigEntityListTest.php index d1dc721..b4f3375 100644 --- a/core/modules/config/lib/Drupal/config/Tests/ConfigEntityListTest.php +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigEntityListTest.php @@ -68,6 +68,9 @@ function testList() { 'delete' => array ( 'title' => t('Delete'), 'href' => $uri['path'] . '/delete', + 'ajax' => array( + 'accepts' => 'application/vnd.drupal-modal', + ), 'options' => $uri['options'], 'weight' => 100, ), @@ -141,6 +144,9 @@ function testList() { 'delete' => array( 'title' => t('Delete'), 'href' => $uri['path'] . '/delete', + 'ajax' => array( + 'accepts' => 'application/vnd.drupal-modal', + ), 'options' => $uri['options'], 'weight' => 100, ), diff --git a/core/modules/config/tests/config_test/lib/Drupal/config_test/ConfigTestFormController.php b/core/modules/config/tests/config_test/lib/Drupal/config_test/ConfigTestFormController.php index 514311b..881a3e9 100644 --- a/core/modules/config/tests/config_test/lib/Drupal/config_test/ConfigTestFormController.php +++ b/core/modules/config/tests/config_test/lib/Drupal/config_test/ConfigTestFormController.php @@ -60,6 +60,9 @@ public function form(array $form, array &$form_state) { $form['actions']['delete'] = array( '#type' => 'submit', '#value' => 'Delete', + '#ajax' => array( + 'accepts' => 'application/vnd.drupal-modal', + ), ); return $form; diff --git a/core/modules/content_translation/content_translation.pages.inc b/core/modules/content_translation/content_translation.pages.inc index 43e5331..b5e140f 100644 --- a/core/modules/content_translation/content_translation.pages.inc +++ b/core/modules/content_translation/content_translation.pages.inc @@ -109,6 +109,9 @@ function content_translation_overview(EntityInterface $entity) { if ($controller->getTranslationAccess($entity, 'delete')) { $links['delete'] = isset($delete_links->links[$langcode]['href']) ? $delete_links->links[$langcode] : array('href' => $delete_links, 'language' => $language); $links['delete']['title'] = t('Delete'); + $links['delete']['ajax'] = array( + 'accepts' => 'application/vnd.drupal-modal', + ); } } } diff --git a/core/modules/content_translation/lib/Drupal/content_translation/ContentTranslationController.php b/core/modules/content_translation/lib/Drupal/content_translation/ContentTranslationController.php index e99c9b0..92c9396 100644 --- a/core/modules/content_translation/lib/Drupal/content_translation/ContentTranslationController.php +++ b/core/modules/content_translation/lib/Drupal/content_translation/ContentTranslationController.php @@ -165,6 +165,9 @@ public function entityFormAlter(array &$form, array &$form_state, EntityInterfac $form['actions']['delete_translation'] = array( '#type' => 'submit', '#value' => t('Delete translation'), + '#ajax' => array( + 'accepts' => 'application/vnd.drupal-modal', + ), '#weight' => $weight, '#submit' => array(array($this, 'entityFormDeleteTranslation')), '#access' => $this->getTranslationAccess($entity, 'delete'), diff --git a/core/modules/field_ui/lib/Drupal/field_ui/FieldOverview.php b/core/modules/field_ui/lib/Drupal/field_ui/FieldOverview.php index c5832e8..f192ccb 100644 --- a/core/modules/field_ui/lib/Drupal/field_ui/FieldOverview.php +++ b/core/modules/field_ui/lib/Drupal/field_ui/FieldOverview.php @@ -155,6 +155,9 @@ public function buildForm(array $form, array &$form_state, $entity_type = NULL, $links['delete'] = array( 'title' => $this->t('Delete'), 'href' => "$admin_field_path/delete", + 'ajax' => array( + 'accepts' => 'application/vnd.drupal-modal', + ), 'attributes' => array('title' => $this->t('Delete instance.')), ); // Allow altering the operations on this entity listing. diff --git a/core/modules/field_ui/lib/Drupal/field_ui/Form/FieldInstanceEditForm.php b/core/modules/field_ui/lib/Drupal/field_ui/Form/FieldInstanceEditForm.php index 3d02cd5..3487ef5 100644 --- a/core/modules/field_ui/lib/Drupal/field_ui/Form/FieldInstanceEditForm.php +++ b/core/modules/field_ui/lib/Drupal/field_ui/Form/FieldInstanceEditForm.php @@ -155,6 +155,9 @@ public function buildForm(array $form, array &$form_state, FieldInstanceInterfac $form['actions']['delete'] = array( '#type' => 'submit', '#value' => $this->t('Delete field'), + '#ajax' => array( + 'accepts' => 'application/vnd.drupal-modal', + ), '#submit' => array(array($this, 'delete')), ); return $form; diff --git a/core/modules/image/lib/Drupal/image/Form/ImageStyleEditForm.php b/core/modules/image/lib/Drupal/image/Form/ImageStyleEditForm.php index c00b009..cdf57ba 100644 --- a/core/modules/image/lib/Drupal/image/Form/ImageStyleEditForm.php +++ b/core/modules/image/lib/Drupal/image/Form/ImageStyleEditForm.php @@ -97,6 +97,9 @@ public function form(array $form, array &$form_state) { $links['delete'] = array( 'title' => $this->t('delete'), 'href' => 'admin/config/media/image-styles/manage/' . $this->entity->id() . '/effects/' . $key . '/delete', + 'ajax' => array( + 'accepts' => 'application/vnd.drupal-modal', + ), ); $form['effects'][$key]['operations'] = array( '#type' => 'operations', @@ -112,6 +115,9 @@ public function form(array $form, array &$form_state) { '#type' => 'link', '#title' => $this->t('delete'), '#href' => 'admin/config/media/image-styles/manage/' . $this->entity->id() . '/effects/' . $key . '/delete', + '#ajax' => array( + 'accepts' => 'application/vnd.drupal-modal', + ), ); } diff --git a/core/modules/menu/lib/Drupal/menu/MenuFormController.php b/core/modules/menu/lib/Drupal/menu/MenuFormController.php index 5e369d5..f8b6ef4 100644 --- a/core/modules/menu/lib/Drupal/menu/MenuFormController.php +++ b/core/modules/menu/lib/Drupal/menu/MenuFormController.php @@ -347,6 +347,9 @@ protected function buildOverviewTreeForm($tree, $delta) { $operations['delete'] = array( 'title' => t('Delete'), 'href' => 'admin/structure/menu/item/' . $item['mlid'] . '/delete', + 'ajax' => array( + 'accepts' => 'application/vnd.drupal-modal', + ), ); } // Set the reset column. diff --git a/core/modules/node/node.module b/core/modules/node/node.module index 8becc7f..9879a6e 100644 --- a/core/modules/node/node.module +++ b/core/modules/node/node.module @@ -88,7 +88,9 @@ function node_help($path, $arg) { $message = t('The content access permissions need to be rebuilt.'); } else { - $message = t('The content access permissions need to be rebuilt. Rebuild permissions.', array('@node_access_rebuild' => url('admin/reports/status/rebuild'))); + // Add the AJAX library to the form for dialog support. + drupal_add_library('system', 'drupal.ajax'); + $message = t('The content access permissions need to be rebuilt. Rebuild permissions.', array('@node_access_rebuild' => url('admin/reports/status/rebuild'))); } drupal_set_message($message, 'error'); } diff --git a/core/modules/node/node.pages.inc b/core/modules/node/node.pages.inc index ad96476..0792907 100644 --- a/core/modules/node/node.pages.inc +++ b/core/modules/node/node.pages.inc @@ -164,12 +164,18 @@ function node_revision_overview($node) { $links['revert'] = array( 'title' => t('Revert'), 'href' => "node/" . $node->id() . "/revisions/" . $revision->vid . "/revert", + 'ajax' => array( + 'accepts' => 'application/vnd.drupal-modal', + ), ); } if ($delete_permission) { $links['delete'] = array( 'title' => t('Delete'), 'href' => "node/" . $node->id() . "/revisions/" . $revision->vid . "/delete", + 'ajax' => array( + 'accepts' => 'application/vnd.drupal-modal', + ), ); } $row[] = array( diff --git a/core/modules/path/path.admin.inc b/core/modules/path/path.admin.inc index b2941a0..d530e7f 100644 --- a/core/modules/path/path.admin.inc +++ b/core/modules/path/path.admin.inc @@ -69,6 +69,9 @@ function path_admin_overview($keys = NULL) { $operations['delete'] = array( 'title' => t('delete'), 'href' => "admin/config/search/path/delete/$data->pid", + 'ajax' => array( + 'accepts' => 'application/vnd.drupal-modal', + ), 'query' => $destination, ); $row['data']['operations'] = array( diff --git a/core/modules/shortcut/lib/Drupal/shortcut/Form/SetCustomize.php b/core/modules/shortcut/lib/Drupal/shortcut/Form/SetCustomize.php index 12a789c..20ff0b6 100644 --- a/core/modules/shortcut/lib/Drupal/shortcut/Form/SetCustomize.php +++ b/core/modules/shortcut/lib/Drupal/shortcut/Form/SetCustomize.php @@ -87,6 +87,9 @@ public function form(array $form, array &$form_state) { $links['delete'] = array( 'title' => t('Delete'), 'href' => "admin/config/user-interface/shortcut/link/$id/delete", + 'ajax' => array( + 'accepts' => 'application/vnd.drupal-modal', + ), ); $form['shortcuts']['links'][$id]['operations'] = array( '#type' => 'operations', diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Form/OverviewTerms.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Form/OverviewTerms.php index 9bd534d..aad2af6 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/Form/OverviewTerms.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Form/OverviewTerms.php @@ -262,6 +262,9 @@ public function buildForm(array $form, array &$form_state, VocabularyInterface $ 'delete' => array( 'title' => $this->t('delete'), 'href' => $uri['path'] . '/delete', + 'ajax' => array( + 'accepts' => 'application/vnd.drupal-modal', + ), 'query' => $destination, ), ); @@ -341,6 +344,9 @@ public function buildForm(array $form, array &$form_state, VocabularyInterface $ ); $form['actions']['reset_alphabetical'] = array( '#type' => 'submit', + '#ajax' => array( + 'accepts' => 'application/vnd.drupal-modal', + ), '#submit' => array(array($this, 'submitReset')), '#value' => $this->t('Reset to alphabetical'), ); diff --git a/core/modules/views_ui/lib/Drupal/views_ui/ViewEditFormController.php b/core/modules/views_ui/lib/Drupal/views_ui/ViewEditFormController.php index 84df38e..d3bcedb 100644 --- a/core/modules/views_ui/lib/Drupal/views_ui/ViewEditFormController.php +++ b/core/modules/views_ui/lib/Drupal/views_ui/ViewEditFormController.php @@ -127,7 +127,7 @@ public function form(array $form, array &$form_state) { $form['locked'] = array( '#type' => 'container', '#attributes' => array('class' => array('view-locked', 'messages', 'messages--warning')), - '#children' => $this->t('This view is being edited by user !user, and is therefore locked from editing by others. This lock is !age old. Click here to break this lock.', $lock_message_substitutions), + '#children' => $this->t('This view is being edited by user !user, and is therefore locked from editing by others. This lock is !age old. Click here to break this lock.', $lock_message_substitutions), '#weight' => -10, ); }