Bug #8140
closedCan't delete users
100%
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
Updated by Alexander Hu about 7 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?
Updated by Alexander Hu about 7 years ago
Tested on stable.chamilo.org -> User is deleted without problems.
Updated by Yannick Warnier almost 7 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
Updated by Alexander Hu almost 7 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?
Updated by Yannick Warnier almost 7 years ago
You probably have old inconsistencies in your access_url_rel_user table. There's a post on the forum about that.
Updated by Yannick Warnier almost 7 years ago
- Assignee changed from Yannick Warnier to Alexander Hu
- Target version deleted (
1.10.4)
Updated by Alexander Hu almost 7 years ago
- File database-content.jpg database-content.jpg added
- File access-url-rel-user.jpg access-url-rel-user.jpg added
- File user.jpg user.jpg added
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.
Updated by Julio Montoya almost 7 years ago
I just added a fix here:
https://github.com/chamilo/chamilo-lms/commit/44706ef925530c642933112adc084cb313e05148
Updated by Alexander Hu almost 7 years ago
- Status changed from Needs testing to Bug resolved
Upgraded to 1.10.4 -> solved.