Project

General

Profile

Bug #8140

Can't delete users

Added by Alexander Hu over 4 years ago. Updated over 4 years ago.

Status:
Bug resolved
Priority:
High
Assignee:
Category:
Users/Groups
Target version:
-
Start date:
17/03/2016
Due date:
% Done:

100%

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

Description

On a fresh stable install, users can register themselves, but the global admin is not able to delete these users.
There is only an error message to contact the platform admin, but nothing in the logs.

Also checked this on unstable.chamilo.org -> registered a new user as admin in the backend -> can't delete because he is teacher in a course -> ???


Files

database-content.jpg (54.9 KB) database-content.jpg some content of the 2 tables Alexander Hu, 23/03/2016 22:02
access-url-rel-user.jpg (107 KB) access-url-rel-user.jpg table access_url_rel_user Alexander Hu, 23/03/2016 22:02
user.jpg (143 KB) user.jpg table user Alexander Hu, 23/03/2016 22:02

Associated revisions

Revision 5c22eb31 (diff)
Added by Yannick Warnier over 4 years ago

Fix issue deleting users - refs #8140

Revision 44706ef9 (diff)
Added by Julio over 4 years ago

Remove user from all portals see #8140

History

#1

Updated by Alexander Hu over 4 years ago

As an addition, i activated debugging, et voila:

Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (`database`.`access_url_rel_user`, CONSTRAINT `FK_85574263A76ED395` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`))' in /var/www/sampledomain/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:104 Stack trace: #0 /var/www/sampledomain/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php(104): PDO->query('DELETE FROM use...') #1 /var/www/sampledomain/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(833): Doctrine\DBAL\Driver\PDOConnection->query('DELETE FROM use...') #2 /var/www/sampledomain/main/inc/lib/database.lib.php(327): Doctrine\DBAL\Connection->executeQuery('DELETE FROM use...') #3 /var/www/sampledomain/main/inc/lib/usermanager.lib.php(597): Database: in /var/www/sampledomain/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php on line 60

Why doesn't this get parsed to the logfile?

#2

Updated by Alexander Hu over 4 years ago

Tested on stable.chamilo.org -> User is deleted without problems.

#3

Updated by Yannick Warnier over 4 years ago

  • Status changed from New to Bug resolved
  • Assignee set to Yannick Warnier
  • Target version set to 1.10.4
  • % Done changed from 0 to 100

A patch was sent for that just before 1.10.4. Thanks for reporting.
https://github.com/chamilo/chamilo-lms/commit/5c22eb31dafc79138159a86648041eff3b1b3ad9

#4

Updated by Alexander Hu over 4 years ago

  • Status changed from Bug resolved to Needs testing

Erm...

Changed the sql statement, still i get:

Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[23000]:
Integrity constraint violation: 1451 Cannot delete or update a parent row:
a foreign key constraint fails (`database`.`access_url_rel_user`, CONSTRAINT `FK_85574263A76ED395` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`))' in
/var/www/sampledomain/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:104
Stack trace:
#0 /var/www/sampledomain/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php(104): PDO->query('DELETE FROM use...')
#1 /var/www/sampledomain/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(833): Doctrine\DBAL\Driver\PDOConnection->query('DELETE FROM use...')
#2 /var/www/sampledomain/main/inc/lib/database.lib.php(327): Doctrine\DBAL\Connection->executeQuery('DELETE FROM use...')
#3 /var/www/sampledomain/main/inc/lib/usermanager.lib.php(597): Database: in /var/www/sampledomain/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php on line 60

Did i miss some other files to change?

#5

Updated by Yannick Warnier over 4 years ago

You probably have old inconsistencies in your access_url_rel_user table. There's a post on the forum about that.

#6

Updated by Yannick Warnier over 4 years ago

  • Assignee changed from Yannick Warnier to Alexander Hu
  • Target version deleted (1.10.4)
#7

Updated by Alexander Hu over 4 years ago

No. This is a fresh, clean install.
If you want, i can give you database and ftp access and you can look for yourself.
This installation has 4 users. All dummy.

#9

Updated by Alexander Hu over 4 years ago

  • Status changed from Needs testing to Bug resolved

Upgraded to 1.10.4 -> solved.

Also available in: Atom PDF