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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

DanZ’s picture

The 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?

DanZ’s picture

The 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.

DanZ’s picture

Status: Closed (fixed) » Fixed

Committed #2.

Status: Active » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.