Commit 11aead58 authored by catch's avatar catch

Issue #2082499 by alexpott: Fixed Uninstalling action module removes actions...

Issue #2082499 by alexpott: Fixed Uninstalling action module removes actions created by the user module.
parent 2e6aaf6a
<?php
/**
* @file
* Contains \Drupal\action\Tests\ActionUninstallTest.
*/
namespace Drupal\action\Tests;
use Drupal\simpletest\WebTestBase;
/**
* Tests action uninstallation.
*
* @see \Drupal\action\Plugin\views\field\BulkForm
*/
class ActionUninstallTest extends WebTestBase {
/**
* Modules to enable.
*
* @var array
*/
public static $modules = array('views', 'action');
public static function getInfo() {
return array(
'name' => 'Uninstall action test',
'description' => 'Tests that uninstalling actions does not remove other module\'s actions.',
'group' => 'Action',
);
}
/**
* Tests Action uninstall.
*/
public function testActionUninstall() {
\Drupal::moduleHandler()->disable(array('action'));
\Drupal::moduleHandler()->uninstall(array('action'));
$this->assertTrue(entity_load('action', 'user_block_user_action', TRUE), 'Configuration entity \'user_block_user_action\' still exists after uninstalling action module.' );
$admin_user = $this->drupalCreateUser(array('administer users'));
$this->drupalLogin($admin_user);
$this->drupalGet('admin/people');
// Ensure we have the user_block_user_action listed.
$this->assertRaw('<option value="user_block_user_action">Block the selected user(s)</option>');
}
}
......@@ -26,7 +26,7 @@
* "storage" = "Drupal\Core\Config\Entity\ConfigStorageController",
* "access" = "Drupal\action\ActionAccessController"
* },
* config_prefix = "action.action",
* config_prefix = "system.action",
* entity_keys = {
* "id" = "id",
* "label" = "label",
......
......@@ -2198,7 +2198,7 @@ function system_update_8057() {
$action['aid'] = $action['callback'] . '_' . $action['aid'];
}
$configuration = unserialize($action['parameters']) ?: array();
Drupal::config('action.action.' . $action['aid'])
Drupal::config('system.action.' . $action['aid'])
->set('id', $action['aid'])
->set('label', $action['label'])
->set('status', '1')
......
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