Page 1 of 1

CompanyDirectory not deleting

Posted: Thu Dec 11, 2008 5:22 am
by clintnelson
Hi,

I'm using CMSMS 1.5.1 with CompanyDirectory 1.1.6 and when I delete a company it removes the entry from the cms_module_compdir_companies table but doesn't remove the corresponding entry from cms_module_compdir_company_categories as is called from action.deletecompany.php

I had this issue with 1.4.1 as well.

Is there any known issue with this?

Thanks
Clint

Re: CompanyDirectory not deleting

Posted: Tue Feb 17, 2009 9:44 pm
by Eliban
you have to edit "action.deletecompany.php"

FIND:
//And remove it from any entries
$query = "DELETE FROM module_compdir_fieldvals WHERE company_id = ?";
$db->Execute($query, array($compid));

//And remove it from any categories
$query = "DELETE FROM module_compdir_company_categories WHERE company_id = ?";
$db->Execute($query, array($compid));


AND CHANGE TO:

//And remove it from any entries
$query = "DELETE FROM ".cms_db_prefix()."module_compdir_fieldvals WHERE company_id = ?";
$db->Execute($query, array($compid));

//And remove it from any categories
$query = "DELETE FROM ".cms_db_prefix()."module_compdir_company_categories WHERE company_id = ?";
$db->Execute($query, array($compid));

Re: CompanyDirectory not deleting

Posted: Tue Feb 17, 2009 10:40 pm
by calguy1000
Fixed in SVN.