Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When a role as been created and assigned to a user and enabled in the configuration, after deleting the role and the user the slot for it remains in the price per role configuration page but just as a blank entry. Ive tried checking the database for a table that is holding this to remove it that way but cant seem to find anything. Have tried clearing all caches too but that didn't do anything either. How do I remove these blank lines?
See screenshot for example.
Comment | File | Size | Author |
---|---|---|---|
#2 | uc_price_per_role_handle_deleted_roles-1771038-2.patch | 3.07 KB | DanZ |
Price Per Role Empty Roles | 127.78 KB | Weighsone |
Comments
Comment #1
DanZ CreditAttribution: DanZ commentedThe problem is that entries are not cleared out of the {uc_price_per_role_prices} or {uc_price_per_role_option_prices} tables when the roles are deleted.
Fixing this requires an implementation of hook_user_role_delete() for ongoing operation. Cleaning it up for sites that already have the problem requires implementation of one of those run-once functions.
Can anyone provide a patch?
Comment #2
DanZ CreditAttribution: DanZ commentedThe data does have to be dropped from the tables, but the bug turns out to be from the deleted role data not being dropped from a configuration variable.
This patch cleans up the configuration variables and tables when roles are dropped. It also does a database update when you install it, so be sure to run update.php.
Comment #3
DanZ CreditAttribution: DanZ commentedCommitted #2.