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

islandora_breadcrumbs should have an uninstall function to remove config #1707

Closed
wgilling opened this issue Nov 19, 2020 · 5 comments
Closed

Comments

@wgilling
Copy link
Contributor

When using drush to enable the islandora_breadcrumbs module if it has been previously installed / uninstalled, the reenabling step islandora_breadcrumbs throws an error.

The output of the error is:

$ drush pm-enable islandora_breadcrumbs

In PreExistingConfigException.php line 65:
                                                                                                                         
  Configuration objects (islandora.breadcrumbs) provided by islandora_breadcrumbs already exist in active configuration  
                                                                                                                         
@alxp
Copy link
Contributor

alxp commented Nov 25, 2020

In the yml file you can set your custom module as a dependency in your YML file by setting "enforced" under dependencies.

For example:

dependencies:
  module:
    - node
  enforced:
    module:
      - custom_module

@wgilling
Copy link
Contributor Author

wgilling commented Nov 25, 2020

I have tried as many variants of this as I can think of and none of it works.

Here is the current islandora_breadcrumbs.info.yml file:

name: 'Islandora Breadcrumbs'
type: module
description: 'Builds breadcrumbs based on field_member_of relationships.'
core: 8.x
package: Islandora
dependencies:
  - islandora

I edited it to this and then tried to uninstall / reinstall yet still get slightly different errors and this does not remove the config settings.

name: 'Islandora Breadcrumbs'
type: module
description: 'Builds breadcrumbs based on field_member_of relationships.'
core: 8.x
package: Islandora
dependencies:
  module:
    - islandora
  enforced:
    module:
      - islandora_breadcrumbs

The errors that this results in are:

$ drush pm-uninstall islandora_breadcrumbs
 [warning] strpos() expects parameter 1 to be string, array given Dependency.php:181
 [warning] explode() expects parameter 2 to be string, array given Dependency.php:182
 [warning] strpos() expects parameter 1 to be string, array given Dependency.php:181
 [warning] explode() expects parameter 2 to be string, array given Dependency.php:182
 [success] Successfully uninstalled: islandora_breadcrumbs

@alxp
Copy link
Contributor

alxp commented Nov 25, 2020

The enforced dependencies bit needs to be in each config yml file in the /config/install folder.

@wgilling
Copy link
Contributor Author

Thanks again @alxp !!! I have it working now and have made a pull request for it against the 8.x-1.x branch.

@seth-shaw-unlv
Copy link
Contributor

Resolved with Islandora/islandora@d76a664.

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

No branches or pull requests

3 participants