Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
423f1d65
Commit
423f1d65
authored
Aug 07, 2013
by
catch
Browse files
Issue
#2020979
by dawehner, bojanz: Fixed Bulk action form no longer allows actions to be selected.
parent
fca30517
Changes
6
Hide whitespace changes
Inline
Side-by-side
core/modules/node/lib/Drupal/node/Plugin/views/field/NodeBulkForm.php
View file @
423f1d65
...
...
@@ -7,8 +7,8 @@
namespace
Drupal\node\Plugin\views\field
;
use
Drupal\views\Plugin\views\field\ActionBulkForm
;
use
Drupal\Component\Annotation\PluginID
;
use
Drupal\system\Plugin\views\field\BulkFormBase
;
use
Drupal\Core\Cache\Cache
;
use
Drupal\Core\Entity\EntityManager
;
...
...
@@ -17,7 +17,7 @@
*
* @PluginID("node_bulk_form")
*/
class
NodeBulkForm
extends
BulkForm
Base
{
class
NodeBulkForm
extends
Action
BulkForm
{
/**
* Constructs a new NodeBulkForm object.
...
...
core/modules/node/lib/Drupal/node/Tests/Views/BulkFormTest.php
View file @
423f1d65
...
...
@@ -25,7 +25,7 @@ public static function getInfo() {
return
array
(
'name'
=>
'Node: Bulk form'
,
'description'
=>
'Tests a node bulk form.'
,
'group'
=>
'Views
M
odule
s
'
,
'group'
=>
'Views
m
odule
integration
'
,
);
}
...
...
core/modules/node/tests/Drupal/node/Tests/Plugin/views/field/NodeBulkFormTest.php
0 → 100644
View file @
423f1d65
<?php
/**
* @file
* Contains \Drupal\node\Tests\Plugin\views\field\NodeBulkFormTest.
*/
namespace
Drupal\node\Tests\Plugin\views\field
;
use
Drupal\node\Plugin\views\field\NodeBulkForm
;
use
Drupal\Tests\UnitTestCase
;
/**
* Tests the node bulk form plugin.
*
* @see \Drupal\node\Plugin\views\field\NodeBulkForm
*/
class
NodeBulkFormTest
extends
UnitTestCase
{
public
static
function
getInfo
()
{
return
array
(
'name'
=>
'Node: Bulk form'
,
'description'
=>
'Tests the node bulk form plugin.'
,
'group'
=>
'Views module integration'
,
);
}
/**
* Tests the constructor assignment of actions.
*/
public
function
testConstructor
()
{
$actions
=
array
();
for
(
$i
=
1
;
$i
<=
2
;
$i
++
)
{
$action
=
$this
->
getMockBuilder
(
'Drupal\system\Plugin\Core\Entity\Action'
)
->
disableOriginalConstructor
()
->
getMock
();
$action
->
expects
(
$this
->
any
())
->
method
(
'getType'
)
->
will
(
$this
->
returnValue
(
'node'
));
$actions
[
$i
]
=
$action
;
}
$action
=
$this
->
getMockBuilder
(
'Drupal\system\Plugin\Core\Entity\Action'
)
->
disableOriginalConstructor
()
->
getMock
();
$action
->
expects
(
$this
->
any
())
->
method
(
'getType'
)
->
will
(
$this
->
returnValue
(
'user'
));
$actions
[]
=
$action
;
$entity_manager
=
$this
->
getMockBuilder
(
'Drupal\Core\Entity\EntityManager'
)
->
disableOriginalConstructor
()
->
getMock
();
$storage_controller
=
$this
->
getMock
(
'Drupal\Core\Entity\EntityStorageControllerInterface'
);
$storage_controller
->
expects
(
$this
->
any
())
->
method
(
'loadMultiple'
)
->
will
(
$this
->
returnValue
(
$actions
));
$entity_manager
->
expects
(
$this
->
any
())
->
method
(
'getStorageController'
)
->
with
(
'action'
)
->
will
(
$this
->
returnValue
(
$storage_controller
));
$node_bulk_form
=
new
NodeBulkForm
(
array
(),
'node_bulk_form'
,
array
(),
$entity_manager
);
$this
->
assertAttributeEquals
(
array_slice
(
$actions
,
0
,
-
1
,
TRUE
),
'actions'
,
$node_bulk_form
);
}
}
core/modules/user/lib/Drupal/user/Plugin/views/field/UserBulkForm.php
View file @
423f1d65
...
...
@@ -7,9 +7,9 @@
namespace
Drupal\user\Plugin\views\field
;
use
Drupal\views\Plugin\views\field\ActionBulkForm
;
use
Drupal\Component\Annotation\PluginID
;
use
Drupal\Core\Entity\EntityManager
;
use
Drupal\system\Plugin\views\field\BulkFormBase
;
use
Drupal\user\UserInterface
;
use
Symfony\Component\DependencyInjection\ContainerInterface
;
...
...
@@ -18,7 +18,7 @@
*
* @PluginID("user_bulk_form")
*/
class
UserBulkForm
extends
BulkForm
Base
{
class
UserBulkForm
extends
Action
BulkForm
{
/**
* {@inheritdoc}
...
...
core/modules/user/tests/Drupal/user/Tests/Plugin/views/field/UserBulkFormTest.php
0 → 100644
View file @
423f1d65
<?php
/**
* @file
* Contains \Drupal\user\Tests\Plugin\views\field\UserBulkFormTest.
*/
namespace
Drupal\user\Tests\Plugin\views\field
;
use
Drupal\Tests\UnitTestCase
;
use
Drupal\user\Plugin\views\field\UserBulkForm
;
/**
* Tests the user bulk form plugin.
*
* @see \Drupal\user\Plugin\views\field\UserBulkForm
*/
class
UserBulkFormTest
extends
UnitTestCase
{
public
static
function
getInfo
()
{
return
array
(
'name'
=>
'User: Bulk form'
,
'description'
=>
'Tests the user bulk form plugin.'
,
'group'
=>
'Views module integration'
,
);
}
/**
* Tests the constructor assignment of actions.
*/
public
function
testConstructor
()
{
$actions
=
array
();
for
(
$i
=
1
;
$i
<=
2
;
$i
++
)
{
$action
=
$this
->
getMockBuilder
(
'Drupal\system\Plugin\Core\Entity\Action'
)
->
disableOriginalConstructor
()
->
getMock
();
$action
->
expects
(
$this
->
any
())
->
method
(
'getType'
)
->
will
(
$this
->
returnValue
(
'user'
));
$actions
[
$i
]
=
$action
;
}
$action
=
$this
->
getMockBuilder
(
'Drupal\system\Plugin\Core\Entity\Action'
)
->
disableOriginalConstructor
()
->
getMock
();
$action
->
expects
(
$this
->
any
())
->
method
(
'getType'
)
->
will
(
$this
->
returnValue
(
'node'
));
$actions
[]
=
$action
;
$entity_manager
=
$this
->
getMockBuilder
(
'Drupal\Core\Entity\EntityManager'
)
->
disableOriginalConstructor
()
->
getMock
();
$storage_controller
=
$this
->
getMock
(
'Drupal\Core\Entity\EntityStorageControllerInterface'
);
$storage_controller
->
expects
(
$this
->
any
())
->
method
(
'loadMultiple'
)
->
will
(
$this
->
returnValue
(
$actions
));
$entity_manager
->
expects
(
$this
->
any
())
->
method
(
'getStorageController'
)
->
with
(
'action'
)
->
will
(
$this
->
returnValue
(
$storage_controller
));
$user_bulk_form
=
new
UserBulkForm
(
array
(),
'user_bulk_form'
,
array
(),
$entity_manager
);
$this
->
assertAttributeEquals
(
array_slice
(
$actions
,
0
,
-
1
,
TRUE
),
'actions'
,
$user_bulk_form
);
}
}
core/modules/
action
/lib/Drupal/
action
/Plugin/views/field/BulkForm.php
→
core/modules/
views
/lib/Drupal/
views
/Plugin/views/field/
Action
BulkForm.php
View file @
423f1d65
...
...
@@ -2,10 +2,10 @@
/**
* @file
* Contains \Drupal\
action
\Plugin\views\field\BulkForm.
* Contains \Drupal\
views
\Plugin\views\field\BulkForm.
*/
namespace
Drupal\
action
\Plugin\views\field
;
namespace
Drupal\
views
\Plugin\views\field
;
use
Drupal\Component\Annotation\PluginID
;
use
Drupal\system\Plugin\views\field\BulkFormBase
;
...
...
@@ -15,7 +15,7 @@
*
* @PluginID("action_bulk_form")
*/
class
BulkForm
extends
BulkFormBase
{
class
Action
BulkForm
extends
BulkFormBase
{
/**
* Overrides \Drupal\views\Plugin\views\field\FieldPluginBase::defineOptions().
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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