Project

General

Profile

Bug #8059

Cannot remove user when has items

Added by Alejandro Gallardo over 3 years ago. Updated almost 3 years ago.

Status:
Rejected - Abandoned
Priority:
Normal
Category:
Database & API changes
Target version:
Start date:
16/01/2016
Due date:
% Done:

50%

Estimated time:
Complexity:
Easy
SCRUM pts - complexity:
?

Description

In Chamilo 1.10.2 foreign key restrictions doesn't allow to remove users when has items.

To fix the bug add this code to main/inc/lib/usermanager.lib.php, before the sql query to remove the user from the table user:

// Delete user from c_item_property
$sql = "UPDATE c_item_property SET to_user_id = NULL WHERE to_user_id = '".$user_id."'";
Database::query($sql);
$sql = "UPDATE c_item_property SET insert_user_id = NULL WHERE insert_user_id = '".$user_id."'";
Database::query($sql);
$sql = "UPDATE c_item_property SET lastedit_user_id = NULL WHERE lastedit_user_id = '".$user_id."'";
Database::query($sql);

History

#1

Updated by Alejandro Gallardo over 3 years ago

  • Target version set to 1.10.4
#2

Updated by AliaMori com over 3 years ago

Have attempted to apply this fix and is still not working. This has also been reported in the Chamilo forum by a different user ( https://chamilo.org/forum/viewtopic.php?f=43&t=7346#p28783 ) Mr. Gallardo kindly indicated that the fix should be added before the following code as indicated below, but this did not work for us. All the best and thank you for your time.

_"Debes añadir el código que compartí en Chamilo Tracking System antes del siguiente:

// Delete user from database

$sql = "DELETE FROM $table_user_ WHERE id = '".$user_id."'";
Database::query($sql); "

#3

Updated by Alejandro Gallardo over 3 years ago

  • % Done changed from 100 to 50

It seems there are more foreign key related restrictions: https://chamilo.org/forum/viewtopic.php?f=43&t=7346&p=28784#p28784

AliaMori com wrote:

Have attempted to apply this fix and is still not working. This has also been reported in the Chamilo forum by a different user ( https://chamilo.org/forum/viewtopic.php?f=43&t=7346#p28783 ) Mr. Gallardo kindly indicated that the fix should be added before the following code as indicated below, but this did not work for us. All the best and thank you for your time.

_"Debes añadir el código que compartí en Chamilo Tracking System antes del siguiente:

// Delete user from database

$sql = "DELETE FROM $table_user_ WHERE id = '".$user_id."'";
Database::query($sql); "

#4

Updated by Julio Montoya over 3 years ago

  • Status changed from New to Needs more info
#5

Updated by AliaMori com over 3 years ago

Two people have tried to apply these fixes without positive results. Reference: https://chamilo.org/forum/viewtopic.php?f=43&t=7346&start=10#p28813
Thanx.

#6

Updated by Alejandro Gallardo over 3 years ago

Please can you post your mysql error log when trying to remove user? In Debian Systems (like the last Jessie stable version) is located in: /var/log/mysql/error.log

AliaMori com wrote:

Two people have tried to apply these fixes without positive results. Reference: https://chamilo.org/forum/viewtopic.php?f=43&t=7346&start=10#p28813
Thanx.

#7

Updated by AliaMori com over 3 years ago

Sorry not able to locate the log file. No access to SSH for the next few weeks. Will forward message to other person with same feedback.

#8

Updated by Yannick Warnier about 3 years ago

  • Target version changed from 1.10.4 to 1.11.0
#9

Updated by Yannick Warnier almost 3 years ago

  • Status changed from Needs more info to Rejected - Abandoned

Closing for lack of feedback. This should have been fixed in 1.10.6 (we fixed a series of other issues related to that).

Also available in: Atom PDF