Commit ce46bf1e authored by alexpott's avatar alexpott
Browse files

Issue #2044865 by Gábor Hojtsy: Fixed Picture mappings cannot be edited.

parent 33c488d5
......@@ -144,7 +144,7 @@ public function save(array $form, array &$form_state) {
// another breakpoint group.
if (!$picture_mapping->hasMappings()) {
$uri = $picture_mapping->uri();
$form_state['redirect'] = $uri['path'] . '/edit';
$form_state['redirect'] = $uri['path'];
}
else {
$form_state['redirect'] = 'admin/config/media/picturemapping';
......
......@@ -102,7 +102,7 @@ public function testPictureAdmin() {
$this->assertText('mapping_one');
// Edit the group.
$this->drupalGet('admin/config/media/picturemapping/mapping_one/edit');
$this->drupalGet('admin/config/media/picturemapping/mapping_one');
$this->assertFieldByName('label', 'Mapping One');
$this->assertFieldByName('breakpointGroup', 'atestset');
......@@ -122,8 +122,8 @@ public function testPictureAdmin() {
'mappings[custom.user.medium][1x]' => 'medium',
'mappings[custom.user.large][1x]' => 'large',
);
$this->drupalPost('admin/config/media/picturemapping/mapping_one/edit', $edit, t('Save'));
$this->drupalGet('admin/config/media/picturemapping/mapping_one/edit');
$this->drupalPost('admin/config/media/picturemapping/mapping_one', $edit, t('Save'));
$this->drupalGet('admin/config/media/picturemapping/mapping_one');
$this->assertFieldByName('mappings[custom.user.small][1x]', 'thumbnail');
$this->assertFieldByName('mappings[custom.user.small][2x]', '');
$this->assertFieldByName('mappings[custom.user.medium][1x]', 'medium');
......
......@@ -64,7 +64,7 @@ function picture_menu() {
'route_name' => 'picture_mapping_page_add',
'type' => MENU_LOCAL_ACTION,
);
$items['admin/config/media/picturemapping/%picture_mapping/edit'] = array(
$items['admin/config/media/picturemapping/%picture_mapping'] = array(
'title' => 'Edit picture mapping',
'route_name' => 'picture_mapping_page_edit',
);
......
......@@ -13,7 +13,7 @@ picture_mapping_page_add:
_permission: 'administer pictures'
picture_mapping_page_edit:
pattern: '/admin/config/media/picturemapping/{picture_mapping}/edit'
pattern: '/admin/config/media/picturemapping/{picture_mapping}'
defaults:
_entity_form: 'picture_mapping.edit'
requirements:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment