When I uninstalled this module, the table defined in `node_convert_schema()` is not deleted. It's because the table name is defined by a contant but it is only defined in .module file. .module file is not loaded in uninstallation process and the constant is not found. As a result, the table is not deleted successfully.

The following message is shown when I used Drush command:

$ drush pm-uninstall node_convert
...
Use of undefined constant NODE_CONVERT_TEMPLATE_TABLE - [notice]
assumed 'NODE_CONVERT_TEMPLATE_TABLE'
node_convert.install:13

Comments

hgoto created an issue. See original summary.

hgoto’s picture

Here is a patch. I'd like someone to test this one. Thank you in advance.

waverate’s picture

This doesn't fix uninstalling an already existing node_convert module. However, after disabling the module and then deleting the node_convert_templates table from the database, future installations worked fine.

Steps to reproduce:

  1. existing node_convert installation that has been disabled
  2. drush en node_convert [original error]
  3. apply patch #2 [success]
  4. drush dis node_convert [success]
  5. drush pmu node_convert [false positive - nothing to uninstall]
  6. drop node_convert_templates table in database
  7. drush en node_convert [success]
  8. drush dis node_convert [success]
  9. drush pmu node_convert [success]

This may be close enough unless you can think of a way to fix an existing installation.

hgoto’s picture

@waverate, thank you for checking the patch and sharing the issue. Thank you but I'm sorry, I cannot reproduce steps from 1 to 5 you showed (I cannot find what's wrong with the patch...). However, thanks to your comment I noticed that it's better to apply the change to the function `node_convert_update_7001()` and it may be better to use `module_load_include()` instead of `drupal_load()`.

hgoto’s picture

Assigned: hgoto » Unassigned
Status: Active » Needs review
waverate’s picture

Status: Needs review » Reviewed & tested by the community

@hgoto patch at #4 is good.

Screenack’s picture

I just hit my head against this issue, so, moving from RTBC to stable will be most helpful.

gisle’s picture

Two years as RBTC and no response from the maintainers. Do you need co-maintainers?