I'm updating a site that was using the contrib actions module but it is disabled at the time of the update. I get a error when I update the site with a message that the table already exists (which of course it does). Marking this critical because the contrib module table on my site is not configured the same as the new core table, so I miss the table updates and end up with a mis-configured table.

CommentFileSizeAuthor
#10 actions_table.patch3.96 KBwebernet
#6 system.install.patch3.55 KBKarenS
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

RobLoach’s picture

Would this be an issue with the Actions contributed module instead of the update path of core Actions module?

Gábor Hojtsy’s picture

Not really. Since the core triggers module replaces the contrib one. (Unless the contrib actions module provides more stuff as addons to trigger module, eg. more actions :).

catch’s picture

Discussed this quickly on irc, and we came to the idea of if table exists actions rename to actions-something, then let a contrib actions module deal with the rest. This was after my if actions exists delete table actions which wasn't so good.

KarenS’s picture

This is similar to the problem when core created a table with the same name as a CCK table. We finally ended up having the core update check if the table already existed, rename it if so, then create its own table. That preserves the old data in case it's needed again by the contrib module, if the contrib module is still going to be used.

KarenS’s picture

Cross-posted with catch, but yes, that's the right idea.

KarenS’s picture

Status: Active » Needs review
FileSize
3.55 KB

OK, here's a patch. This worked for me. Lots of extra line endings for some reason, but it works.

RobLoach’s picture

Think it should move the Actions from the old table into the new one?

KarenS’s picture

I have no idea if the old actions will work in the new system, plus there are different column names in the tables so I don't even know if they map to each other, so didn't. I don't know enough about actions to take that any further.

KarenS’s picture

Again going back to the way this was handled when core took over a CCK table, core just renamed the table. Then CCK took data from the renamed table and decided what to do about moving it to the new core table. That's probably the right way to handle this issue, too.

webernet’s picture

FileSize
3.96 KB

Rerolled the patch:
-Added a comment
-Renames table to 'actions_old_contrib'

chx’s picture

Status: Needs review » Reviewed & tested by the community

Looks really nice. Simple, to the point and fixes the problem.

Gábor Hojtsy’s picture

Status: Reviewed & tested by the community » Needs review

Looks like trigger module's install function should need to do the same? (I actually have no idea how install hooks protect themselves from crashing on possibly pre-existing tables).

Gábor Hojtsy’s picture

Status: Needs review » Fixed

Actually, all upgraders need to go through this, and those installing later should not have an actions table from before, so no problem here. Committed.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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