Issue #2815301 by Chi, DanielVeza, kostyashupenko, smustgrave: Allow to create any kind of actions through UI
parent
85c9ee6ab8
commit
f38c23939a
|
@ -53,9 +53,7 @@ class ActionAdminManageForm extends FormBase {
|
|||
public function buildForm(array $form, FormStateInterface $form_state) {
|
||||
$actions = [];
|
||||
foreach ($this->manager->getDefinitions() as $id => $definition) {
|
||||
if (is_subclass_of($definition['class'], '\Drupal\Core\Plugin\PluginFormInterface')) {
|
||||
$actions[$id] = $definition['label'];
|
||||
}
|
||||
$actions[$id] = $definition['label'];
|
||||
}
|
||||
asort($actions);
|
||||
$form['parent'] = [
|
||||
|
|
|
@ -16,7 +16,7 @@ class ActionListTest extends BrowserTestBase {
|
|||
*
|
||||
* @var array
|
||||
*/
|
||||
protected static $modules = ['action'];
|
||||
protected static $modules = ['action', 'user'];
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
|
@ -39,4 +39,13 @@ class ActionListTest extends BrowserTestBase {
|
|||
$this->assertSession()->pageTextContains('There are no actions yet.');
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests that non-configurable actions can be created by the UI.
|
||||
*/
|
||||
public function testNonConfigurableActionsCanBeCreated() {
|
||||
$this->drupalLogin($this->drupalCreateUser(['administer actions']));
|
||||
$this->drupalGet('/admin/config/system/actions');
|
||||
$this->assertSession()->elementExists('css', 'select > option[value="user_block_user_action"]');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue