Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
bc65e535
Commit
bc65e535
authored
Feb 13, 2014
by
Nathaniel Catchpole
Browse files
Issue
#2187335
by mondrake: Cannot delete image styles from UI any longer.
parent
54f8683d
Changes
3
Hide whitespace changes
Inline
Side-by-side
core/modules/image/lib/Drupal/image/Entity/ImageStyle.php
View file @
bc65e535
...
...
@@ -41,7 +41,8 @@
* },
* links = {
* "flush-form" = "image.style_flush",
* "edit-form" = "image.style_edit"
* "edit-form" = "image.style_edit",
* "delete-form" = "image.style_delete"
* }
* )
*/
...
...
core/modules/image/lib/Drupal/image/Form/ImageEffectFormBase.php
View file @
bc65e535
...
...
@@ -86,6 +86,7 @@ public function buildForm(array $form, array &$form_state, ImageStyleInterface $
'#value'
=>
$request
->
query
->
has
(
'weight'
)
?
(
int
)
$request
->
query
->
get
(
'weight'
)
:
$this
->
imageEffect
->
getWeight
(),
);
$image_style_uri
=
$this
->
imageStyle
->
urlInfo
(
'edit-form'
);
$form
[
'actions'
]
=
array
(
'#type'
=>
'actions'
);
$form
[
'actions'
][
'submit'
]
=
array
(
'#type'
=>
'submit'
,
...
...
@@ -94,7 +95,8 @@ public function buildForm(array $form, array &$form_state, ImageStyleInterface $
$form
[
'actions'
][
'cancel'
]
=
array
(
'#type'
=>
'link'
,
'#title'
=>
$this
->
t
(
'Cancel'
),
'#href'
=>
'admin/config/media/image-styles/manage/'
.
$this
->
imageStyle
->
id
(),
'#route_name'
=>
$image_style_uri
[
'route_name'
],
'#route_parameters'
=>
$image_style_uri
[
'route_parameters'
],
);
return
$form
;
}
...
...
core/modules/image/lib/Drupal/image/Tests/ImageAdminStylesTest.php
View file @
bc65e535
...
...
@@ -67,10 +67,12 @@ function testNumericStyleName() {
* General test to add a style, add/remove/edit effects to it, then delete it.
*/
function
testStyle
()
{
$admin_path
=
'admin/config/media/image-styles'
;
// Setup a style to be created and effects to add to it.
$style_name
=
strtolower
(
$this
->
randomName
(
10
));
$style_label
=
$this
->
randomString
();
$style_path
=
'
admin
/config/media/image-styles
/manage/'
.
$style_name
;
$style_path
=
$
admin
_path
.
'
/manage/'
.
$style_name
;
$effect_edits
=
array
(
'image_resize'
=>
array
(
'data[width]'
=>
100
,
...
...
@@ -106,9 +108,15 @@ function testStyle() {
'name'
=>
$style_name
,
'label'
=>
$style_label
,
);
$this
->
drupalPostForm
(
'
admin
/config/media/image-styles
/add'
,
$edit
,
t
(
'Create new style'
));
$this
->
drupalPostForm
(
$
admin
_path
.
'
/add'
,
$edit
,
t
(
'Create new style'
));
$this
->
assertRaw
(
t
(
'Style %name was created.'
,
array
(
'%name'
=>
$style_label
)));
// Ensure that the expected entity operations are there.
$this
->
drupalGet
(
$admin_path
);
$this
->
assertLinkByHref
(
$style_path
);
$this
->
assertLinkByHref
(
$style_path
.
'/flush'
);
$this
->
assertLinkByHref
(
$style_path
.
'/delete'
);
// Add effect form.
// Add each sample effect to the style.
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment