Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[module:uninstall] Can't uninstall module if it is in the profile list #1916

Closed
ddrozdik opened this issue Feb 12, 2016 · 6 comments
Closed
Labels

Comments

@ddrozdik
Copy link
Contributor

Hi,

I have a custom profile in my Drupal installation. This profile contains list of modules (https://github.com/DmitryDrozdik/dmaps/blob/master/d8/profiles/pp/pp.info.yml), which should be installed during installation Drupal profile.

After successful installation, I can not uninstall module(dmaps), added to the profile list. But I should be able to do this. Uninstalling module works well on the Drupal "uninstall page".

@dmouse dmouse added the bug label Feb 13, 2016
@itsdarrylnorris
Copy link
Contributor

@DmitryDrozdik Do you know if you can uninstall from the UI ? I am just curios if this is expected behavior from DrupalCore not allowing uninstall dependency from profiles.

@ddrozdik
Copy link
Contributor Author

@darol100 yes, of course I can. Drupal profile - this is installation profile, it will be used when you install the Drupal. But after installation, you can do everything you want with your modules.

@alexbarrett
Copy link

This still seems to be an issue. I wanted to uninstall the core search module but was unable to do so with Drupal Console.

$ drupal mou search

[ERROR] Unable to uninstall modules "search" because are required by "standard"

Uninstalling via the admin/modules/uninstall page works fine.

@cburschka-pwc
Copy link
Contributor

Simple missing-line bug, looks like.

core:

      $profile = drupal_get_profile();
      while (list($module) = each($module_list)) {
        foreach (array_keys($module_data[$module]->required_by) as $dependent) {
          if (!isset($module_data[$dependent])) {
            // The dependent module does not exist.
            return FALSE;
          }

          // Skip already uninstalled modules.
          if (isset($installed_modules[$dependent]) && !isset($module_list[$dependent]) && $dependent != $profile) {
            $module_list[$dependent] = $dependent;
          }
        }
      }

UninstallCommand:

            $dependencies = [];
            while (list($module) = each($moduleList)) {
                foreach (array_keys($moduleData[$module]->required_by) as $dependency) {
                    if (isset($installedModules[$dependency]) && !isset($moduleList[$dependency]) && $dependency != $profile) {
                        $dependencies[] = $dependency;
                    }
                }
            }

You can actually see the $profile variable get marked as undefined in the IDE.

@jmolivas
Copy link
Member

jmolivas commented Jul 6, 2017

Another option is to pass --force

@jmolivas
Copy link
Member

jmolivas commented Jul 6, 2017

drupal mou search --force

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants