[Vtigercrm-commits] [Vtiger development] #6993: Related list items are deleted instead of being unlinked
Vtiger development
vtiger-tickets at trac.vtiger.com
Tue Aug 19 09:29:19 GMT 2014
#6993: Related list items are deleted instead of being unlinked
----------------------------+----------------------
Reporter: davidv.net | Owner: asha
Type: Need More Info | Status: closed
Priority: major | Milestone: 5.4.0
Component: vtigercrm | Version: 5.2.1
Severity: Critical | Resolution: wontfix
Keywords: |
----------------------------+----------------------
Changes (by prasad):
* status: assigned => closed
* resolution: => wontfix
Old description:
> If a module is related to itself in a related list and one tries to
> delete a record from the related list, the record is sent to trash
> instead of just being unlinked.
>
> More info : http://lists.vtigercrm.com/pipermail/vtigercrm-
> developers/2011-January/016016.html
>
> Quick workaround is to change the function DeleteEntity in
> /include/utils/Utils.php
> from :
> function DeleteEntity($module,$return_module,$focus,$record,$return_id) {
> global $log;
> $log->debug("Entering DeleteEntity method ($module,
> $return_module, $record, $return_id)");
>
> if ($module != $return_module && !empty($return_module) &&
> !empty($return_id)) {
> $focus->unlinkRelationship($record, $return_module,
> $return_id);
> } else {
> $focus->trash($module, $record);
> }
> $log->debug("Exiting DeleteEntity method ...");
> }
>
> to :
>
> function DeleteEntity($module,$return_module,$focus,$record,$return_id) {
> global $log;
> $log->debug("Entering DeleteEntity method ($module,
> $return_module, $record, $return_id)");
>
> if (isset($_REQUEST['return_action'])){
> $return_action = $_REQUEST['return_action'];
> } else {
> $return_action = "";
> }
>
> if ($return_action == "CallRelatedList" && !empty($return_module)
> && !empty($return_id)) {
> $focus->unlinkRelationship($record, $return_module,
> $return_id);
> } else {
> $focus->trash($module, $record);
> }
> $log->debug("Exiting DeleteEntity method ...");
> }
>
> IMPORTANT : This workaround will not work in singlepane view.
> see : http://lists.vtigercrm.com/pipermail/vtigercrm-
> developers/2011-January/016018.html
New description:
If a module is related to itself in a related list and one tries to delete
a record from the related list, the record is sent to trash instead of
just being unlinked.
More info : http://lists.vtigercrm.com/pipermail/vtigercrm-
developers/2011-January/016016.html
Quick workaround is to change the function DeleteEntity in
/include/utils/Utils.php
from :
function DeleteEntity($module,$return_module,$focus,$record,$return_id) {
global $log;
$log->debug("Entering DeleteEntity method ($module,
$return_module, $record, $return_id)");
if ($module != $return_module && !empty($return_module) &&
!empty($return_id)) {
$focus->unlinkRelationship($record, $return_module,
$return_id);
} else {
$focus->trash($module, $record);
}
$log->debug("Exiting DeleteEntity method ...");
}
to :
function DeleteEntity($module,$return_module,$focus,$record,$return_id) {
global $log;
$log->debug("Entering DeleteEntity method ($module,
$return_module, $record, $return_id)");
if (isset($_REQUEST['return_action'])){
$return_action = $_REQUEST['return_action'];
} else {
$return_action = "";
}
if ($return_action == "CallRelatedList" && !empty($return_module)
&& !empty($return_id)) {
$focus->unlinkRelationship($record, $return_module,
$return_id);
} else {
$focus->trash($module, $record);
}
$log->debug("Exiting DeleteEntity method ...");
}
IMPORTANT : This workaround will not work in singlepane view.
see : http://lists.vtigercrm.com/pipermail/vtigercrm-
developers/2011-January/016018.html
--
Comment:
This has been taken care in 6.0.0 - please plan to upgrade.
--
Ticket URL: <http://trac.vtiger.com/cgi-bin/trac.cgi/ticket/6993#comment:5>
Vtiger development <http://trac.vtiger.com/>
Vtiger CRM
More information about the vtigercrm-commits
mailing list