Commit 0dee8fb3 authored by Russell Blakeborough's avatar Russell Blakeborough
Browse files

Issue #1483672 by russellb: Tidy up variables made by multi vocab code on uninstall

parent f9156219
Loading
Loading
Loading
Loading
+25 −0
Changes for taxonomy_nco.install: 25 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -105,4 +105,29 @@ function taxonomy_nco_uninstall() {
  variable_del('taxonomy_nco_minimum_match_intersection');
  variable_del('taxonomy_nco_analysis_last_update');
  variable_del('taxonomy_nco_last_cron');
  
  // tidy up multi variables
  // TODO: upgrade this so that is only deletes variables made by this module, not the
  // whole taxonomy_nco variable namespace
  // TODO: separate uninstall for taxonomy_nco and taxonomy_nco_anaylsis
  db_delete('variable')
    ->condition('name', "taxonomy_nco%", "LIKE")
    ->execute();  
      
  /*
   *  from issue #1483672
   * 
   *    Here are the "multi" variable we use:
   *    taxonomy_nco'.$multi_id.'_include_tags_in_related
   *	taxonomy_nco'.$multi_id.'_minimum_match_intersection
   *	taxonomy_nco'.$multi_id.'_default_minimum_match_nco
   *	taxonomy_nco_block'.$multi_id.'_vocabularies
   *		
   *	so something like
   *	if (preg_match('/^taxonomy_nco(_block(_\d+)?_vocabularies|(_\d+)?_(include_tags_in_related|minimum_match_intersection|default_minimum_match_nco))$/',$varname)) variable_del($varname);
   *    in the loop, could do the trick in a safe way.
   *		
   *	PS: and maybe a loop on the $conf keys is better than a db select...
   */  
    
}
 No newline at end of file