diff --git a/core/modules/ckeditor/lib/Drupal/ckeditor/Tests/CKEditorAdminTest.php b/core/modules/ckeditor/lib/Drupal/ckeditor/Tests/CKEditorAdminTest.php index bb17201..0ca0425 100644 --- a/core/modules/ckeditor/lib/Drupal/ckeditor/Tests/CKEditorAdminTest.php +++ b/core/modules/ckeditor/lib/Drupal/ckeditor/Tests/CKEditorAdminTest.php @@ -51,7 +51,7 @@ function testAdmin() { $ckeditor = $manager->createInstance('ckeditor'); $this->drupalLogin($this->admin_user); - $this->drupalGet('admin/config/content/formats/filtered_html'); + $this->drupalGet('admin/config/content/formats/manage/filtered_html'); // Ensure no Editor config entity exists yet. $editor = entity_load('editor', 'filtered_html'); @@ -114,7 +114,7 @@ function testAdmin() { $this->assertIdentical($expected_settings, $editor->settings, 'The Editor config entity has the correct settings.'); // Configure the Styles plugin, and ensure the updated settings are saved. - $this->drupalGet('admin/config/content/formats/filtered_html'); + $this->drupalGet('admin/config/content/formats/manage/filtered_html'); $edit = array( 'editor[settings][plugins][stylescombo][styles]' => "h1.title|Title\np.callout|Callout\n\n", ); @@ -127,7 +127,7 @@ function testAdmin() { // Change the buttons that appear on the toolbar (in JavaScript, this is // done via drag and drop, but here we can only emulate the end result of // that interaction). Test multiple toolbar rows and a divider within a row. - $this->drupalGet('admin/config/content/formats/filtered_html'); + $this->drupalGet('admin/config/content/formats/manage/filtered_html'); $expected_settings['toolbar']['buttons'] = array( array('Undo', '|', 'Redo'), array('JustifyCenter'), @@ -144,7 +144,7 @@ function testAdmin() { // CKEditor plugin — this should not affect the Editor config entity. module_enable(array('ckeditor_test')); drupal_container()->get('plugin.manager.ckeditor.plugin')->clearCachedDefinitions(); - $this->drupalGet('admin/config/content/formats/filtered_html'); + $this->drupalGet('admin/config/content/formats/manage/filtered_html'); $ultra_llama_mode_checkbox = $this->xpath('//input[@type="checkbox" and @name="editor[settings][plugins][llama_contextual_and_button][ultra_llama_mode]" and not(@checked)]'); $this->assertTrue(count($ultra_llama_mode_checkbox) === 1, 'The "Ultra llama mode" checkbox exists and is not checked.'); $editor = entity_load('editor', 'filtered_html'); @@ -152,12 +152,12 @@ function testAdmin() { $this->assertIdentical($expected_settings, $editor->settings, 'The Editor config entity has the correct settings.'); // Finally, check the "Ultra llama mode" checkbox. - $this->drupalGet('admin/config/content/formats/filtered_html'); + $this->drupalGet('admin/config/content/formats/manage/filtered_html'); $edit = array( 'editor[settings][plugins][llama_contextual_and_button][ultra_llama_mode]' => '1', ); $this->drupalPost(NULL, $edit, t('Save configuration')); - $this->drupalGet('admin/config/content/formats/filtered_html'); + $this->drupalGet('admin/config/content/formats/manage/filtered_html'); $ultra_llama_mode_checkbox = $this->xpath('//input[@type="checkbox" and @name="editor[settings][plugins][llama_contextual_and_button][ultra_llama_mode]" and @checked="checked"]'); $this->assertTrue(count($ultra_llama_mode_checkbox) === 1, 'The "Ultra llama mode" checkbox exists and is checked.'); $expected_settings['plugins']['llama_contextual_and_button']['ultra_llama_mode'] = '1'; diff --git a/core/modules/editor/editor.module b/core/modules/editor/editor.module index 0f317b9..c4fea8e 100644 --- a/core/modules/editor/editor.module +++ b/core/modules/editor/editor.module @@ -142,11 +142,11 @@ function editor_form_filter_admin_overview_alter(&$form, $form_state) { } /** - * Implements hook_form_FORM_ID_alter(). + * Implements hook_form_BASE_FORM_ID_alter() for 'filter_format_form'. */ -function editor_form_filter_admin_format_form_alter(&$form, &$form_state) { +function editor_form_filter_format_form_alter(&$form, &$form_state) { if (!isset($form_state['editor'])) { - $format_id = $form['#format']->format; + $format_id = $form_state['controller']->getEntity()->id(); $form_state['editor'] = editor_load($format_id); $form_state['editor_manager'] = drupal_container()->get('plugin.manager.editor'); } @@ -214,7 +214,7 @@ function editor_form_filter_admin_format_form_alter(&$form, &$form_state) { } /** - * Button submit handler for filter_admin_format_form()'s 'editor_configure' button. + * Button submit handler for filter_format_form()'s 'editor_configure' button. */ function editor_form_filter_admin_format_editor_configure($form, &$form_state) { $editor = $form_state['editor']; @@ -224,7 +224,7 @@ function editor_form_filter_admin_format_editor_configure($form, &$form_state) { } elseif (empty($editor) || $form_state['values']['editor']['editor'] !== $editor->editor) { $editor = entity_create('editor', array( - 'format' => $form['#format']->format, + 'format' => $form_state['controller']->getEntity()->id(), 'editor' => $form_state['values']['editor']['editor'], )); $form_state['editor'] = $editor; @@ -234,18 +234,18 @@ function editor_form_filter_admin_format_editor_configure($form, &$form_state) { } /** - * AJAX callback handler for filter_admin_format_form(). + * AJAX callback handler for filter_format_form(). */ function editor_form_filter_admin_form_ajax($form, &$form_state) { return $form['editor']['settings']; } /** - * Additional submit handler for filter_admin_format_form(). + * Additional submit handler for filter_format_form(). */ function editor_form_filter_admin_format_submit($form, &$form_state) { // Delete the existing editor if disabling or switching between editors. - $format_id = $form['#format']->format; + $format_id = $form_state['controller']->getEntity()->id(); $original_editor = editor_load($format_id); if ($original_editor && $original_editor->editor != $form_state['values']['editor']) { $original_editor->delete(); @@ -255,7 +255,7 @@ function editor_form_filter_admin_format_submit($form, &$form_state) { if ($form_state['values']['editor']['editor'] !== '') { // Ensure the text format is set: when creating a new text format, this // would equal the empty string. - $form_state['editor']->format = $form['#format']->format; + $form_state['editor']->format = $form_state['controller']->getEntity()->id(); $form_state['editor']->settings = $form_state['values']['editor']['settings']; $form_state['editor']->save(); } diff --git a/core/modules/editor/lib/Drupal/editor/Tests/EditorAdminTest.php b/core/modules/editor/lib/Drupal/editor/Tests/EditorAdminTest.php index 27cc458..0bc89e1 100644 --- a/core/modules/editor/lib/Drupal/editor/Tests/EditorAdminTest.php +++ b/core/modules/editor/lib/Drupal/editor/Tests/EditorAdminTest.php @@ -50,7 +50,7 @@ function setUp() { */ function testNoEditorAvailable() { $this->drupalLogin($this->admin_user); - $this->drupalGet('admin/config/content/formats/filtered_html'); + $this->drupalGet('admin/config/content/formats/manage/filtered_html'); // Ensure the form field order is correct. $roles_pos = strpos($this->drupalGetContent(), 'Roles'); @@ -75,7 +75,7 @@ function testNoEditorAvailable() { function testAddEditorToExistingFormat() { $this->enableUnicornEditor(); $this->drupalLogin($this->admin_user); - $this->drupalGet('admin/config/content/formats/filtered_html'); + $this->drupalGet('admin/config/content/formats/manage/filtered_html'); $edit = $this->selectUnicornEditor(); // Configure Unicorn Editor's setting to another value. $edit['editor[settings][foo]'] = 'baz'; @@ -155,7 +155,7 @@ protected function verifyUnicornEditorConfiguration($format_id, $foo = 'bar') { $this->assertIdentical($editor->settings['ponies too'], true, 'The text editor defaults are retrieved correctly.'); $this->assertIdentical($editor->settings['rainbows'], true, 'The text editor defaults added by hook_editor_settings_defaults() are retrieved correctly.'); $this->assertIdentical($editor->settings['sparkles'], false, 'The text editor defaults modified by hook_editor_settings_defaults_alter() are retrieved correctly.'); - $this->drupalGet('admin/config/content/formats/'. $format_id); + $this->drupalGet('admin/config/content/formats/manage/'. $format_id); $select = $this->xpath('//select[@name="editor[editor]"]'); $select_is_disabled = $this->xpath('//select[@name="editor[editor]" and @disabled="disabled"]'); $options = $this->xpath('//select[@name="editor[editor]"]/option'); diff --git a/core/modules/filter/filter.admin.inc b/core/modules/filter/filter.admin.inc deleted file mode 100644 index a4493a9..0000000 --- a/core/modules/filter/filter.admin.inc +++ /dev/null @@ -1,348 +0,0 @@ - 'table', - '#header' => array(t('Name'), t('Roles'), t('Weight'), t('Operations')), - '#tabledrag' => array( - array('order', 'sibling', 'text-format-order-weight'), - ), - ); - foreach ($formats as $id => $format) { - $form['formats'][$id]['#attributes']['class'][] = 'draggable'; - $form['formats'][$id]['#weight'] = $format->weight; - - $links = array(); - $links['configure'] = array( - 'title' => t('configure'), - 'href' => "admin/config/content/formats/$id", - ); - // Check whether this is the fallback text format. This format is available - // to all roles and cannot be disabled via the admin interface. - $form['formats'][$id]['#is_fallback'] = ($id == $fallback_format); - if ($form['formats'][$id]['#is_fallback']) { - $form['formats'][$id]['name'] = array('#markup' => drupal_placeholder($format->name)); - if (config('filter.settings')->get('always_show_fallback_choice')) { - $roles_markup = drupal_placeholder(t('All roles may use this format')); - } - else { - $roles_markup = drupal_placeholder(t('This format is shown when no other formats are available')); - } - } - else { - $form['formats'][$id]['name'] = array('#markup' => check_plain($format->name)); - $roles = array_map('check_plain', filter_get_roles_by_format($format)); - $roles_markup = $roles ? implode(', ', $roles) : t('No roles may use this format'); - $links['disable'] = array( - 'title' => t('disable'), - 'href' => "admin/config/content/formats/$id/disable", - ); - } - - $form['formats'][$id]['roles'] = array('#markup' => $roles_markup); - - $form['formats'][$id]['weight'] = array( - '#type' => 'weight', - '#title' => t('Weight for @title', array('@title' => $format->name)), - '#title_display' => 'invisible', - '#default_value' => $format->weight, - '#attributes' => array('class' => array('text-format-order-weight')), - ); - - $form['formats'][$id]['operations'] = array( - '#type' => 'operations', - '#links' => $links, - ); - } - $form['actions'] = array('#type' => 'actions'); - $form['actions']['submit'] = array('#type' => 'submit', '#value' => t('Save changes')); - return $form; -} - -/** - * Form submission handler for filter_admin_overview(). - */ -function filter_admin_overview_submit($form, &$form_state) { - $filter_formats = filter_formats(); - foreach ($form_state['values']['formats'] as $id => $data) { - // Only update if this is a form element with weight. - if (is_array($data) && isset($data['weight'])) { - $filter_formats[$id]->set('weight', $data['weight']); - $filter_formats[$id]->save(); - } - } - filter_formats_reset(); - drupal_set_message(t('The text format ordering has been saved.')); -} - -/** - * Page callback: Displays the text format add/edit form. - * - * @param object|null $format - * (optional) An object representing a format, with the following properties: - * - format: A machine-readable name representing the ID of the text format - * to save. If this corresponds to an existing text format, that format - * will be updated; otherwise, a new format will be created. - * - name: The title of the text format. - * - cache: An integer indicating whether the text format is cacheable (1) or - * not (0). Defaults to 1. - * - status: (optional) An integer indicating whether the text format is - * enabled (1) or not (0). Defaults to 1. - * - weight: (optional) The weight of the text format, which controls its - * placement in text format lists. If omitted, the weight is set to 0. - * Defaults to NULL. - * - * @return - * A form array. - * - * @see filter_menu() - */ -function filter_admin_format_page($format = NULL) { - if (!isset($format->name)) { - drupal_set_title(t('Add text format')); - - $format = entity_create('filter_format', array()); - } - return drupal_get_form('filter_admin_format_form', $format); -} - -/** - * Form constructor for the text format add/edit form. - * - * @param $format - * A format object having the properties: - * - format: A machine-readable name representing the ID of the text format to - * save. If this corresponds to an existing text format, that format will be - * updated; otherwise, a new format will be created. - * - name: The title of the text format. - * - cache: (optional) An integer indicating whether the text format is - * cacheable (1) or not (0). Defaults to 1. - * - status: (optional) An integer indicating whether the text format is - * enabled (1) or not (0). Defaults to 1. - * - weight: (optional) The weight of the text format, which controls its - * placement in text format lists. If omitted, the weight is set to 0. - * - * @see filter_admin_format_form_validate() - * @see filter_admin_format_form_submit() - * @ingroup forms - */ -function filter_admin_format_form($form, &$form_state, $format) { - $is_fallback = ($format->format == filter_fallback_format()); - - $form['#format'] = $format; - $form['#tree'] = TRUE; - $form['#attached']['library'][] = array('filter', 'drupal.filter.admin'); - - $form['name'] = array( - '#type' => 'textfield', - '#title' => t('Name'), - '#default_value' => $format->name, - '#required' => TRUE, - '#weight' => -30, - ); - $form['format'] = array( - '#type' => 'machine_name', - '#required' => TRUE, - '#default_value' => $format->format, - '#maxlength' => 255, - '#machine_name' => array( - 'exists' => 'filter_format_exists', - 'source' => array('name'), - ), - '#disabled' => !empty($format->format), - '#weight' => -20, - ); - // @todo Remove once moved to FilterFormatFormController. - $form['langcode'] = array( - '#type' => 'value', - '#value' => !$format->isNew() ? $format->langcode : language_default()->langcode, - ); - - // Add user role access selection. - $form['roles'] = array( - '#type' => 'checkboxes', - '#title' => t('Roles'), - '#options' => array_map('check_plain', user_role_names()), - '#disabled' => $is_fallback, - '#weight' => -10, - ); - if ($is_fallback) { - $form['roles']['#description'] = t('All roles for this text format must be enabled and cannot be changed.'); - } - if (!empty($format->format)) { - // If editing an existing text format, pre-select its current permissions. - $form['roles']['#default_value'] = array_keys(filter_get_roles_by_format($format)); - } - elseif ($admin_role = config('user.settings')->get('admin_role')) { - // If adding a new text format and the site has an administrative role, - // pre-select that role so as to grant administrators access to the new - // text format permission by default. - $form['roles']['#default_value'] = array($admin_role); - } - - // Create filter plugin instances for all available filters, including both - // enabled/configured ones as well as new and not yet unconfigured ones. - $filters = $format->filters()->sort(); - - // Filter status. - $form['filters']['status'] = array( - '#type' => 'item', - '#title' => t('Enabled filters'), - '#prefix' => '
' . t('Text formats are presented on content editing pages in the order defined on this page. The first format available to a user will be selected by default.') . '
'; return $output; - case 'admin/config/content/formats/%': + case 'admin/config/content/formats/manage/%': $output = '' . t('A text format contains filters that change the user input, for example stripping out malicious HTML or making URLs clickable. Filters are executed from top to bottom and the order is important, since one filter may prevent another filter from doing its job. For example, when URLs are converted into links before disallowed HTML tags are removed, all links may be removed. When this happens, the order of filters may need to be re-arranged.') . '
'; return $output; } @@ -131,10 +131,7 @@ function filter_menu() { $items['admin/config/content/formats'] = array( 'title' => 'Text formats', 'description' => 'Configure how content input by users is filtered, including allowed HTML tags. Also allows enabling of module-provided filters.', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('filter_admin_overview'), - 'access arguments' => array('administer filters'), - 'file' => 'filter.admin.inc', + 'route_name' => 'filter_admin_overview', ); $items['admin/config/content/formats/list'] = array( 'title' => 'List', @@ -142,20 +139,13 @@ function filter_menu() { ); $items['admin/config/content/formats/add'] = array( 'title' => 'Add text format', - 'page callback' => 'filter_admin_format_page', - 'access arguments' => array('administer filters'), + 'route_name' => 'filter_format_add', 'type' => MENU_LOCAL_ACTION, - 'file' => 'filter.admin.inc', ); - $items['admin/config/content/formats/%filter_format'] = array( - 'title callback' => 'filter_admin_format_title', - 'title arguments' => array(4), - 'page callback' => 'filter_admin_format_page', - 'page arguments' => array(4), - 'access arguments' => array('administer filters'), - 'file' => 'filter.admin.inc', + $items['admin/config/content/formats/manage/%'] = array( + 'route_name' => 'filter_format_edit', ); - $items['admin/config/content/formats/%filter_format/disable'] = array( + $items['admin/config/content/formats/manage/%filter_format/disable'] = array( 'title' => 'Disable text format', 'route_name' => 'filter_admin_disable', ); @@ -233,7 +223,7 @@ function filter_permission() { if (!empty($permission)) { // Only link to the text format configuration page if the user who is // viewing this will have access to that page. - $format_name_replacement = user_access('administer filters') ? l($format->name, 'admin/config/content/formats/' . $format->format) : drupal_placeholder($format->name); + $format_name_replacement = user_access('administer filters') ? l($format->name, 'admin/config/content/formats/manage/' . $format->format) : drupal_placeholder($format->name); $perms[$permission] = array( 'title' => t("Use the !text_format text format", array('!text_format' => $format_name_replacement,)), 'description' => drupal_placeholder(t('Warning: This permission may have security implications depending on how the text format is configured.')), diff --git a/core/modules/filter/filter.routing.yml b/core/modules/filter/filter.routing.yml index de9e9cb..9334d5f 100644 --- a/core/modules/filter/filter.routing.yml +++ b/core/modules/filter/filter.routing.yml @@ -1,6 +1,28 @@ filter_admin_disable: - pattern: '/admin/config/content/formats/{filter_format}/disable' + pattern: '/admin/config/content/formats/manage/{filter_format}/disable' defaults: _form: '\Drupal\filter\Form\DisableForm' requirements: _filter_disable_format_access: 'TRUE' + +filter_admin_overview: + pattern: '/admin/config/content/formats' + defaults: + _content: '\Drupal\Core\Entity\Controller\EntityListController::listing' + entity_type: 'filter_format' + requirements: + _permission: 'administer filters' + +filter_format_add: + pattern: '/admin/config/content/formats/add' + defaults: + _entity_form: filter_format.add + requirements: + _permission: 'administer filters' + +filter_format_edit: + pattern: '/admin/config/content/formats/manage/{filter_format}' + defaults: + _entity_form: filter_format.edit + requirements: + _permission: 'administer filters' diff --git a/core/modules/filter/lib/Drupal/filter/FilterFormatAddFormController.php b/core/modules/filter/lib/Drupal/filter/FilterFormatAddFormController.php new file mode 100644 index 0000000..6180ef7 --- /dev/null +++ b/core/modules/filter/lib/Drupal/filter/FilterFormatAddFormController.php @@ -0,0 +1,32 @@ + $this->entity->label()))); + return $this->entity; + } + +} diff --git a/core/modules/filter/lib/Drupal/filter/FilterFormatEditFormController.php b/core/modules/filter/lib/Drupal/filter/FilterFormatEditFormController.php new file mode 100644 index 0000000..695239d --- /dev/null +++ b/core/modules/filter/lib/Drupal/filter/FilterFormatEditFormController.php @@ -0,0 +1,34 @@ +entity->label()); + $form = parent::form($form, $form_state); + $form['roles']['#default_value'] = array_keys(filter_get_roles_by_format($this->entity)); + return $form; + } + + /** + * {@inheritdoc} + */ + public function submit(array $form, array &$form_state) { + parent::submit($form, $form_state); + drupal_set_message(t('The text format %format has been updated.', array('%format' => $this->entity->label()))); + return $this->entity; + } + +} diff --git a/core/modules/filter/lib/Drupal/filter/FilterFormatFormControllerBase.php b/core/modules/filter/lib/Drupal/filter/FilterFormatFormControllerBase.php new file mode 100644 index 0000000..6574f73 --- /dev/null +++ b/core/modules/filter/lib/Drupal/filter/FilterFormatFormControllerBase.php @@ -0,0 +1,206 @@ +entity; + $is_fallback = ($format->id() == filter_fallback_format()); + + $form['#tree'] = TRUE; + $form['#attached']['library'][] = array('filter', 'drupal.filter.admin'); + + $form['name'] = array( + '#type' => 'textfield', + '#title' => t('Name'), + '#default_value' => $format->label(), + '#required' => TRUE, + '#weight' => -30, + ); + $form['format'] = array( + '#type' => 'machine_name', + '#required' => TRUE, + '#default_value' => $format->id(), + '#maxlength' => 255, + '#machine_name' => array( + 'exists' => 'filter_format_exists', + 'source' => array('name'), + ), + '#disabled' => !$format->isNew(), + '#weight' => -20, + ); + + // Add user role access selection. + $form['roles'] = array( + '#type' => 'checkboxes', + '#title' => t('Roles'), + '#options' => array_map('check_plain', user_role_names()), + '#disabled' => $is_fallback, + '#weight' => -10, + ); + if ($is_fallback) { + $form['roles']['#description'] = t('All roles for this text format must be enabled and cannot be changed.'); + } + if (!$format->isNew()) { + // If editing an existing text format, pre-select its current permissions. + $form['roles']['#default_value'] = array_keys(filter_get_roles_by_format($format)); + } + elseif ($admin_role = config('user.settings')->get('admin_role')) { + // If adding a new text format and the site has an administrative role, + // pre-select that role so as to grant administrators access to the new + // text format permission by default. + $form['roles']['#default_value'] = array($admin_role); + } + + // Create filter plugin instances for all available filters, including both + // enabled/configured ones as well as new and not yet unconfigured ones. + $filters = $format->filters()->sort(); + + // Filter status. + $form['filters']['status'] = array( + '#type' => 'item', + '#title' => t('Enabled filters'), + '#prefix' => ' -
-
-
';
- $this->drupalPost('admin/config/content/formats/' . $restricted, $edit, t('Save configuration'));
+ $this->drupalPost('admin/config/content/formats/manage/' . $restricted, $edit, t('Save configuration'));
$this->assertUrl('admin/config/content/formats');
- $this->drupalGet('admin/config/content/formats/' . $restricted);
+ $this->drupalGet('admin/config/content/formats/manage/' . $restricted);
$this->assertFieldByName('filters[filter_html][settings][allowed_html]', $edit['filters[filter_html][settings][allowed_html]'], 'Allowed HTML tag added.');
$this->assertTrue(cache('filter')->isEmpty(), 'Cache cleared.');
@@ -158,7 +158,7 @@ function testFilterAdmin() {
$edit['filters[' . $first_filter . '][weight]'] = 2;
$this->drupalPost(NULL, $edit, t('Save configuration'));
$this->assertUrl('admin/config/content/formats');
- $this->drupalGet('admin/config/content/formats/' . $restricted);
+ $this->drupalGet('admin/config/content/formats/manage/' . $restricted);
$this->assertFieldByName('filters[' . $second_filter . '][weight]', 1, 'Order saved successfully.');
$this->assertFieldByName('filters[' . $first_filter . '][weight]', 2, 'Order saved successfully.');
@@ -191,13 +191,13 @@ function testFilterAdmin() {
drupal_static_reset('filter_formats');
$format = filter_format_load($edit['format']);
$this->assertNotNull($format, 'Format found in database.');
- $this->drupalGet('admin/config/content/formats/' . $format->format);
+ $this->drupalGet('admin/config/content/formats/manage/' . $format->format);
$this->assertFieldByName('roles[' . DRUPAL_AUTHENTICATED_RID . ']', '', 'Role found.');
$this->assertFieldByName('filters[' . $second_filter . '][status]', '', 'Line break filter found.');
$this->assertFieldByName('filters[' . $first_filter . '][status]', '', 'Url filter found.');
// Disable new filter.
- $this->drupalPost('admin/config/content/formats/' . $format->format . '/disable', array(), t('Disable'));
+ $this->drupalPost('admin/config/content/formats/manage/' . $format->format . '/disable', array(), t('Disable'));
$this->assertUrl('admin/config/content/formats');
$this->assertRaw(t('Disabled text format %format.', array('%format' => $edit['name'])), 'Format successfully disabled.');
@@ -206,7 +206,7 @@ function testFilterAdmin() {
$edit = array();
$edit['roles[' . DRUPAL_ANONYMOUS_RID . ']'] = 0;
$edit['roles[' . DRUPAL_AUTHENTICATED_RID . ']'] = 1;
- $this->drupalPost('admin/config/content/formats/' . $full, $edit, t('Save configuration'));
+ $this->drupalPost('admin/config/content/formats/manage/' . $full, $edit, t('Save configuration'));
$this->assertUrl('admin/config/content/formats');
$this->assertRaw(t('The text format %format has been updated.', array('%format' => $format->name)), 'Full HTML format successfully updated.');
@@ -257,27 +257,27 @@ function testFilterAdmin() {
// Allowed tags.
$edit = array();
$edit['filters[filter_html][settings][allowed_html]'] = ' -
-
- ';
- $this->drupalPost('admin/config/content/formats/' . $basic, $edit, t('Save configuration'));
+ $this->drupalPost('admin/config/content/formats/manage/' . $basic, $edit, t('Save configuration'));
$this->assertUrl('admin/config/content/formats');
- $this->drupalGet('admin/config/content/formats/' . $basic);
+ $this->drupalGet('admin/config/content/formats/manage/' . $basic);
$this->assertFieldByName('filters[filter_html][settings][allowed_html]', $edit['filters[filter_html][settings][allowed_html]'], 'Changes reverted.');
// Full HTML.
$edit = array();
$edit['roles[' . DRUPAL_AUTHENTICATED_RID . ']'] = FALSE;
- $this->drupalPost('admin/config/content/formats/' . $full, $edit, t('Save configuration'));
+ $this->drupalPost('admin/config/content/formats/manage/' . $full, $edit, t('Save configuration'));
$this->assertUrl('admin/config/content/formats');
$this->assertRaw(t('The text format %format has been updated.', array('%format' => $format->name)), 'Full HTML format successfully reverted.');
- $this->drupalGet('admin/config/content/formats/' . $full);
+ $this->drupalGet('admin/config/content/formats/manage/' . $full);
$this->assertFieldByName('roles[' . DRUPAL_AUTHENTICATED_RID . ']', $edit['roles[' . DRUPAL_AUTHENTICATED_RID . ']'], 'Changes reverted.');
// Filter order.
$edit = array();
$edit['filters[' . $second_filter . '][weight]'] = 2;
$edit['filters[' . $first_filter . '][weight]'] = 1;
- $this->drupalPost('admin/config/content/formats/' . $basic, $edit, t('Save configuration'));
+ $this->drupalPost('admin/config/content/formats/manage/' . $basic, $edit, t('Save configuration'));
$this->assertUrl('admin/config/content/formats');
- $this->drupalGet('admin/config/content/formats/' . $basic);
+ $this->drupalGet('admin/config/content/formats/manage/' . $basic);
$this->assertFieldByName('filters[' . $second_filter . '][weight]', $edit['filters[' . $second_filter . '][weight]'], 'Changes reverted.');
$this->assertFieldByName('filters[' . $first_filter . '][weight]', $edit['filters[' . $first_filter . '][weight]'], 'Changes reverted.');
}
@@ -290,7 +290,7 @@ function testUrlFilterAdmin() {
$edit = array(
'filters[filter_url][settings][filter_url_length]' => $this->randomName(4),
);
- $this->drupalPost('admin/config/content/formats/basic_html', $edit, t('Save configuration'));
+ $this->drupalPost('admin/config/content/formats/manage/basic_html', $edit, t('Save configuration'));
$this->assertNoRaw(t('The text format %format has been updated.', array('%format' => 'Basic HTML')));
}
}
diff --git a/core/modules/filter/lib/Drupal/filter/Tests/FilterHooksTest.php b/core/modules/filter/lib/Drupal/filter/Tests/FilterHooksTest.php
index 442eff4..6f4d98b 100644
--- a/core/modules/filter/lib/Drupal/filter/Tests/FilterHooksTest.php
+++ b/core/modules/filter/lib/Drupal/filter/Tests/FilterHooksTest.php
@@ -59,7 +59,7 @@ function testFilterHooks() {
// Update text format.
$edit = array();
$edit['roles[' . DRUPAL_AUTHENTICATED_RID . ']'] = 1;
- $this->drupalPost('admin/config/content/formats/' . $format_id, $edit, t('Save configuration'));
+ $this->drupalPost('admin/config/content/formats/manage/' . $format_id, $edit, t('Save configuration'));
$this->assertRaw(t('The text format %format has been updated.', array('%format' => $name)));
$this->assertText('hook_filter_format_update invoked.');
@@ -75,7 +75,7 @@ function testFilterHooks() {
$this->assertText(t('@type @title has been created.', array('@type' => $type_name, '@title' => $title)));
// Disable the text format.
- $this->drupalPost('admin/config/content/formats/' . $format_id . '/disable', array(), t('Disable'));
+ $this->drupalPost('admin/config/content/formats/manage/' . $format_id . '/disable', array(), t('Disable'));
$this->assertRaw(t('Disabled text format %format.', array('%format' => $name)));
$this->assertText('hook_filter_format_disable invoked.');
}
diff --git a/core/modules/filter/lib/Drupal/filter/Tests/FilterSecurityTest.php b/core/modules/filter/lib/Drupal/filter/Tests/FilterSecurityTest.php
index aa3f390..6f1aba5 100644
--- a/core/modules/filter/lib/Drupal/filter/Tests/FilterSecurityTest.php
+++ b/core/modules/filter/lib/Drupal/filter/Tests/FilterSecurityTest.php
@@ -80,7 +80,7 @@ function testDisableFilterModule() {
$edit = array(
'filters[filter_test_replace][status]' => 1,
);
- $this->drupalPost('admin/config/content/formats/' . $format_id, $edit, t('Save configuration'));
+ $this->drupalPost('admin/config/content/formats/manage/' . $format_id, $edit, t('Save configuration'));
// Verify that filter_test_replace filter replaced the content.
$this->drupalGet('node/' . $node->nid);
@@ -88,7 +88,7 @@ function testDisableFilterModule() {
$this->assertText('Filter: Testing filter', 'Testing filter output found.');
// Disable the text format entirely.
- $this->drupalPost('admin/config/content/formats/' . $format_id . '/disable', array(), t('Disable'));
+ $this->drupalPost('admin/config/content/formats/manage/' . $format_id . '/disable', array(), t('Disable'));
// Verify that the content is empty, because the text format does not exist.
$this->drupalGet('node/' . $node->nid);
diff --git a/core/modules/php/lib/Drupal/php/Tests/PhpTestBase.php b/core/modules/php/lib/Drupal/php/Tests/PhpTestBase.php
index c18273a..a8a875c 100644
--- a/core/modules/php/lib/Drupal/php/Tests/PhpTestBase.php
+++ b/core/modules/php/lib/Drupal/php/Tests/PhpTestBase.php
@@ -47,7 +47,7 @@ function setUp() {
$this->assertText('PHP code', 'PHP code text format was created.');
// Verify that anonymous and authenticated user roles do not have access.
- $this->drupalGet('admin/config/content/formats/' . $php_format_id);
+ $this->drupalGet('admin/config/content/formats/manage/' . $php_format_id);
$this->assertFieldByName('roles[' . DRUPAL_ANONYMOUS_RID . ']', FALSE, 'Anonymous users do not have access to PHP code format.');
$this->assertFieldByName('roles[' . DRUPAL_AUTHENTICATED_RID . ']', FALSE, 'Authenticated users do not have access to PHP code format.');
}
diff --git a/core/modules/search/lib/Drupal/search/Tests/SearchCommentTest.php b/core/modules/search/lib/Drupal/search/Tests/SearchCommentTest.php
index 04d78a4..2424511 100644
--- a/core/modules/search/lib/Drupal/search/Tests/SearchCommentTest.php
+++ b/core/modules/search/lib/Drupal/search/Tests/SearchCommentTest.php
@@ -61,7 +61,7 @@ function testSearchResultsComment() {
$edit = array(
'filters[filter_html_escape][status]' => TRUE,
);
- $this->drupalPost('admin/config/content/formats/' . $basic_html_format_id, $edit, t('Save configuration'));
+ $this->drupalPost('admin/config/content/formats/manage/' . $basic_html_format_id, $edit, t('Save configuration'));
// Allow anonymous users to search content.
$edit = array(
DRUPAL_ANONYMOUS_RID . '[search content]' => 1,
diff --git a/core/modules/system/lib/Drupal/system/Tests/Menu/BreadcrumbTest.php b/core/modules/system/lib/Drupal/system/Tests/Menu/BreadcrumbTest.php
index 2801321..2038f35 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Menu/BreadcrumbTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Menu/BreadcrumbTest.php
@@ -165,11 +165,11 @@ function testBreadCrumbs() {
'admin/config/content/formats' => t('Text formats and editors'),
);
$this->assertBreadcrumb('admin/config/content/formats/add', $trail);
- $this->assertBreadcrumb("admin/config/content/formats/$format_id", $trail);
+ $this->assertBreadcrumb("admin/config/content/formats/manage/$format_id", $trail);
$trail += array(
- "admin/config/content/formats/$format_id" => $format->name,
+ "admin/config/content/formats/manage/$format_id" => $format->name,
);
- $this->assertBreadcrumb("admin/config/content/formats/$format_id/disable", $trail);
+ $this->assertBreadcrumb("admin/config/content/formats/manage/$format_id/disable", $trail);
// Verify node breadcrumbs (without menu link).
$node1 = $this->drupalCreateNode();
diff --git a/core/modules/text/lib/Drupal/text/Tests/TextFieldTest.php b/core/modules/text/lib/Drupal/text/Tests/TextFieldTest.php
index e12553f..002aa06 100644
--- a/core/modules/text/lib/Drupal/text/Tests/TextFieldTest.php
+++ b/core/modules/text/lib/Drupal/text/Tests/TextFieldTest.php
@@ -187,7 +187,7 @@ function _testTextfieldWidgetsFormatted($field_type, $widget_type) {
$this->drupalLogin($this->admin_user);
foreach (filter_formats() as $format) {
if ($format->format != filter_fallback_format()) {
- $this->drupalPost('admin/config/content/formats/' . $format->format . '/disable', array(), t('Disable'));
+ $this->drupalPost('admin/config/content/formats/manage/' . $format->format . '/disable', array(), t('Disable'));
}
}
$this->drupalLogin($this->web_user);