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
971a73c6
Commit
971a73c6
authored
Aug 23, 2016
by
Alex Pott
Browse files
Issue
#2705823
by Lendude, Crell: BulkForm reports incorrect count
parent
73306d92
Changes
2
Hide whitespace changes
Inline
Side-by-side
core/modules/node/src/Tests/Views/BulkFormAccessTest.php
View file @
971a73c6
...
...
@@ -116,6 +116,10 @@ public function testNodeEditAccess() {
'action'
=>
'node_unpublish_action'
,
);
$this
->
drupalPostForm
(
'test-node-bulk-form'
,
$edit
,
t
(
'Apply to selected items'
));
// Test that the action message isn't shown.
$this
->
assertNoRaw
(
SafeMarkup
::
format
(
'%action was applied to 1 item.'
,
[
'%action'
=>
'Unpublish content'
,
]));
// Re-load the node and check the status.
$node
=
Node
::
load
(
$node
->
id
());
$this
->
assertTrue
(
$node
->
isPublished
(),
'The node is still published.'
);
...
...
core/modules/system/src/Plugin/views/field/BulkForm.php
View file @
971a73c6
...
...
@@ -380,7 +380,6 @@ public function viewsFormSubmit(&$form, FormStateInterface $form_state) {
else
{
// Don't display the message unless there are some elements affected and
// there is no confirmation form.
$count
=
count
(
array_filter
(
$form_state
->
getValue
(
$this
->
options
[
'id'
])));
if
(
$count
)
{
drupal_set_message
(
$this
->
formatPlural
(
$count
,
'%action was applied to @count item.'
,
'%action was applied to @count items.'
,
array
(
'%action'
=>
$action
->
label
(),
...
...
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