diff --git a/crop.links.menu.yml b/crop.links.menu.yml index d38131a..0b7c96c 100644 --- a/crop.links.menu.yml +++ b/crop.links.menu.yml @@ -1,5 +1,5 @@ crop.overview_types: title: 'Crop types' - parent: system.admin_structure + parent: system.admin_config_media description: 'Manage crop types.' route_name: crop.overview_types diff --git a/crop.routing.yml b/crop.routing.yml index 2150b05..9b6f979 100644 --- a/crop.routing.yml +++ b/crop.routing.yml @@ -1,5 +1,5 @@ crop.overview_types: - path: '/admin/structure/crop' + path: '/admin/config/media/crop' defaults: _controller: '\Drupal\Core\Entity\Controller\EntityListController::listing' entity_type: 'crop_type' @@ -8,7 +8,7 @@ crop.overview_types: _permission: 'administer crop types' crop.type_add: - path: '/admin/structure/crop/add' + path: '/admin/config/media/crop/add' defaults: _entity_form: 'crop_type.add' _title: 'Add crop type' @@ -16,14 +16,14 @@ crop.type_add: _permission: 'administer crop types' entity.crop_type.edit_form: - path: '/admin/structure/crop/manage/{crop_type}' + path: '/admin/config/media/crop/manage/{crop_type}' defaults: _entity_form: 'crop_type.edit' requirements: _permission: 'administer crop types' entity.crop_type.delete_form: - path: '/admin/structure/crop/manage/{crop_type}/delete' + path: '/admin/config/media/crop/manage/{crop_type}/delete' defaults: _entity_form: 'crop_type.delete' _title: 'Delete' diff --git a/src/Entity/CropType.php b/src/Entity/CropType.php index 0363a00..763114e 100644 --- a/src/Entity/CropType.php +++ b/src/Entity/CropType.php @@ -29,8 +29,8 @@ use Symfony\Component\Validator\ConstraintViolationList; * "label" = "label", * }, * links = { - * "edit-form" = "/admin/structure/crop/manage/{crop_type}", - * "delete-form" = "/admin/structure/crop/manage/{crop_type}/delete", + * "edit-form" = "/admin/config/media/crop/manage/{crop_type}", + * "delete-form" = "/admin/config/media/crop/manage/{crop_type}/delete", * }, * constraints = { * "CropTypeMachineNameValidation" = {}, diff --git a/src/Tests/CropFunctionalTest.php b/src/Tests/CropFunctionalTest.php index 961f405..2c8f14c 100644 --- a/src/Tests/CropFunctionalTest.php +++ b/src/Tests/CropFunctionalTest.php @@ -61,14 +61,14 @@ class CropFunctionalTest extends WebTestBase { */ public function testCropTypeCrud() { // Anonymous users don't have access to crop type admin pages. - $this->drupalGet('admin/structure/crop'); + $this->drupalGet('admin/config/media/crop'); $this->assertResponse(403); - $this->drupalGet('admin/structure/crop/add'); + $this->drupalGet('admin/config/media/crop/add'); $this->assertResponse(403); // Can access pages if logged in and no crop types exist. $this->drupalLogin($this->adminUser); - $this->drupalGet('admin/structure/crop'); + $this->drupalGet('admin/config/media/crop'); $this->assertResponse(200); $this->assertText(t('No crop types available.')); $this->assertLink(t('Add crop type')); @@ -76,7 +76,7 @@ class CropFunctionalTest extends WebTestBase { // Can access add crop type form. $this->clickLink(t('Add crop type')); $this->assertResponse(200); - $this->assertUrl('admin/structure/crop/add'); + $this->assertUrl('admin/config/media/crop/add'); // Create crop type. $edit = [ @@ -84,9 +84,9 @@ class CropFunctionalTest extends WebTestBase { 'label' => $this->randomMachineName(), 'description' => $this->randomGenerator->sentences(10), ]; - $this->drupalPostForm('admin/structure/crop/add', $edit, t('Save crop type')); + $this->drupalPostForm('admin/config/media/crop/add', $edit, t('Save crop type')); $this->assertRaw(t('The crop type %name has been added.', ['%name' => $edit['label']])); - $this->assertUrl('admin/structure/crop'); + $this->assertUrl('admin/config/media/crop'); $label = $this->xpath("//td[contains(concat(' ',normalize-space(@class),' '),' menu-label ')]"); $this->assert(strpos($label[0]->asXML(), $edit['label']) !== FALSE, 'Crop type label found on listing page.'); $this->assertText($edit['description']); @@ -112,20 +112,20 @@ class CropFunctionalTest extends WebTestBase { // Try to access edit form as anonymous user. $this->drupalLogout(); - $this->drupalGet('admin/structure/crop/manage/' . $edit['id']); + $this->drupalGet('admin/config/media/crop/manage/' . $edit['id']); $this->assertResponse(403); $this->drupalLogin($this->adminUser); // Try to create crop type with same machine name. - $this->drupalPostForm('admin/structure/crop/add', $edit, t('Save crop type')); + $this->drupalPostForm('admin/config/media/crop/add', $edit, t('Save crop type')); $this->assertText(t('The machine-readable name is already in use. It must be unique.')); // Delete crop type. - $this->drupalGet('admin/structure/crop'); + $this->drupalGet('admin/config/media/crop'); $this->assertLink('Test image style'); $this->clickLink(t('Delete')); $this->assertText(t('Are you sure you want to delete the crop type @name?', ['@name' => $edit['label']])); - $this->drupalPostForm('admin/structure/crop/manage/' . $edit['id'] . '/delete', [], t('Delete')); + $this->drupalPostForm('admin/config/media/crop/manage/' . $edit['id'] . '/delete', [], t('Delete')); $this->assertRaw(t('The crop type %name has been deleted.', ['%name' => $edit['label']])); $this->assertText(t('No crop types available.')); }