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.
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.
Comment | File | Size | Author |
---|---|---|---|
#10 | actions_table.patch | 3.96 KB | webernet |
#6 | system.install.patch | 3.55 KB | KarenS |
Comments
Comment #1
RobLoachWould this be an issue with the Actions contributed module instead of the update path of core Actions module?
Comment #2
Gábor HojtsyNot 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 :).
Comment #3
catchDiscussed 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.
Comment #4
KarenS CreditAttribution: KarenS commentedThis 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.
Comment #5
KarenS CreditAttribution: KarenS commentedCross-posted with catch, but yes, that's the right idea.
Comment #6
KarenS CreditAttribution: KarenS commentedOK, here's a patch. This worked for me. Lots of extra line endings for some reason, but it works.
Comment #7
RobLoachThink it should move the Actions from the old table into the new one?
Comment #8
KarenS CreditAttribution: KarenS commentedI 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.
Comment #9
KarenS CreditAttribution: KarenS commentedAgain 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.
Comment #10
webernet CreditAttribution: webernet commentedRerolled the patch:
-Added a comment
-Renames table to 'actions_old_contrib'
Comment #11
chx CreditAttribution: chx commentedLooks really nice. Simple, to the point and fixes the problem.
Comment #12
Gábor HojtsyLooks 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).
Comment #13
Gábor HojtsyActually, all upgraders need to go through this, and those installing later should not have an actions table from before, so no problem here. Committed.
Comment #14
Anonymous (not verified) CreditAttribution: Anonymous commentedAutomatically closed -- issue fixed for two weeks with no activity.