D7: Handle circular dependency between quant and quant_api

Created on 19 July 2023, 12 months ago

Problem/Motivation

With quant.info listing quant:quant_api as a dependency and quant_api listing quant:quant as a dependency then you have a circular dependency that makes it so you can't uninstall either module:

Steps to reproduce

Kristens-MacBook-Pro:quantcdn kristenpol$ ddev drush pm:list |grep quant
 Quant           Quant (quant)                                           Module  Enabled                    
 Quant           Quant API (quant_api)                                   Module  Enabled                    
 Quant           Quant Cron (quant_cron)                                 Module  Not installed              
 Quant           Quant File (quant_file)                                 Module  Not installed              
 Quant           Quant Redirects (quant_redirect)                        Module  Not installed              
 Quant           Quant scheduler (quant_scheduler)                       Module  Not installed              
 Quant           Quant sitemap (quant_sitemap)                           Module  Not installed              
Kristens-MacBook-Pro:quantcdn kristenpol$ ddev drush pm:disable quant
The following extensions will be disabled: quant, quant_api
Do you really want to continue? (y/n): y
quant was disabled successfully.                                                                                                                                               [ok]
quant_api was disabled successfully.                                                                                                                                           [ok]
Kristens-MacBook-Pro:quantcdn kristenpol$ ddev drush pm:uninstall quant
To uninstall quant, the following modules must be uninstalled first: quant_api, quant                                                                                          [error]
There were no modules that could be uninstalled.                                                                                                                               [ok]
Kristens-MacBook-Pro:quantcdn kristenpol$ ddev drush pm:uninstall quant_api
To uninstall quant_api, the following modules must be uninstalled first: quant_api, quant                                                                                      [error]
There were no modules that could be uninstalled.                                                                                                                               [ok]
Kristens-MacBook-Pro:quantcdn kristenpol$ ddev drush pm:uninstall quant_api quant
To uninstall quant_api, the following modules must be uninstalled first: quant_api, quant                                                                                      [error]
To uninstall quant, the following modules must be uninstalled first: quant_api, quant                                                                                          [error]
There were no modules that could be uninstalled.                                                                  

Proposed resolution

Update quant_api to not have quant as a dependency in the info file yet still require that it's installed since it uses things like the quant_help helper function.

Remaining tasks

  • Update code
  • Review and test
  • Commit :)

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States Kristen Pol Santa Cruz, CA, USA

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024