cvs up -dPC
patch -p0 < admin_role_fix_3.patch
drop all table, and used install.php
turn on the a module which has uninstall hook
turn off the module
uninstall the module
turn on the module
You see the following:
(this example is with the aggregator module)
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '3-administer news feeds' for key 1: INSERT INTO {role_permission} (rid, permission) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1); Array ( [:db_insert_placeholder_0] => 3 [:db_insert_placeholder_1] => administer news feeds ) in user_modules_installed() (line 942 of /home/pp/munka/drupal/drupal-cvs/modules/user/user.admin.inc).
I suggest deleting all permissions of the module when uninstalling it.
see more info in #482346: node_modules_installed() implementation not invoked (located in include file) #17 and #18
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 503554.patch | 1.92 KB | pp |
| #1 | user_modules_uninstalled.patch | 999 bytes | catch |
Comments
Comment #1
catchPatch.
Comment #2
pp commentedThe patch resolves the bug. I think we should add a test. I added a test which catches this bug but it isn't perfect. The correct test would catch all similar bugs. I am afraid this will be a different issue.
What is the problem?
There is a module which has modules_installed hook and it has not modules_uninsalled hook or this hook is wrong.
The test steps(my idea):
1. Enable all modules which has modules_installed hook. (now it is unnecessary because only User and Field module have this hook and all these modules are always enabled. :))
2. Enable, disable, uninstall, enable all other modules.
3. Repeat these two steps until similar modules are present.
pp
Comment #3
catchpp I think that test is fine - just realised this is actually a duplicate of #306027: user_modules_uninistalled() is missing which solves the more general issue so moving things over there (including your test into a merged patch).