Fork me on GitHub

delete categories on uninstall?  Bottom

  • Should a module delete categories it created upon uninstall?
  • My personal opinion is no. The dev can not assume that the categories are not used by other modules or category registries. But hey, the best solution is probably to use interactive uninstall procedure and ask the admin icon_smile

    --
    Guite | ModuleStudio
  • I would tend to agree with the premise, but what about the registry entry? Surely, that should be deleted?

    I am working on my delete routine and trying to remove category registry entries. I've copied the delete routine from News (same as Pages, etc).

    Anyway - it doesn't work!

    Code

    // Delete entries from category registry
        pnModDBInfoLoad ('Categories');
        Loader::loadArrayClassFromModule('Categories', 'CategoryRegistry');
        $registry = new PNCategoryRegistryArray();
        $registry->deleteWhere ('crg_modname=\'PostCalendar\'');


    I tried to trace it, but am not fluent in OO. I think that the deleteWhere method is returned as false because the deletePreProcess method is not defined in PNCategoryRegistryArray class. therefore, the routine silently fails.

    ideas?
  • 0 users

This list is based on users active over the last 60 minutes.