After I uninstalled realname from a site, I continued to get this error "orphaned actions (realname_action_realname_update) exist in the actions table" If the realname module codebase was found in my distribution's profile folder. I can prevent the issue by deleting the realname module files.

CommentFileSizeAuthor
#1 orphaned-action-1992642-1.patch756 bytesshrop

Comments

shrop’s picture

Status: Active » Needs review
Issue tags: +Guardr
StatusFileSize
new756 bytes

That attached patch resolves the issue I was having by using actions_delete() during uninstall to remove the action from the database.

I also updated two issues found by Drupal Code Sniffer:

  1. Missing file doc comment
  2. A comma should follow the last multiline array item. Found: )
dave reid’s picture

Status: Needs review » Postponed (maintainer needs more info)

It's not a standard practice for a module to run actions_delete() on it's own action. The watchdog message you saw should have given you a link to remove the orphaned actions. Why not just click on that link?

shrop’s picture

Dave,

Thanks for the quick response. So, the expected way to clear things up is to wait for actions_synchronize() to execute and remove the orphaned action? Maybe not the fault of realname, but that hasn't happened so far. I am sure drush cc all has been run many times on our live server and the action still exists in the db.

To answer your actual question, This problem usual occurs when our devs copy down a copy of the live db to a local environment to work. We have have been deleting the realname module form the codebase to stop throwing the error, but after weeks, the action "realname_action_realname_update" still persists int he live db.

It may not be standard practice, but does it hurt to delete the action during uninstall since it isn't needed and can't be used without the module?

Thanks man!

dave reid’s picture

The key is actions_synchronize() doesn't actually remove orphaned actions. It throws a watchdog message about them and tells you to visit admin/config/system/actions/orphan to remove them. If you visit that URL on your live db, it should be removed.

shrop’s picture

Status: Postponed (maintainer needs more info) » Closed (won't fix)

Makes sense. Thanks for your time explaining this a bit.