Hi, I've recently updated my site from D6 to D7.
When I enable the uc_affiliate2 module I get the following error:
PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'admin_stagingst7x30.uc_affiliate2_user_commission' doesn't exist: SELECT * FROM {uc_affiliate2_user_commission} WHERE uid IN (:uids_0); Array ( [:uids_0] => 1 ) in uc_affiliate2_user_load() (line 382 of /home/projects/sooperthemesv3/staging-st-7x-30/sites/all/modules/uc_affiliate2/uc_affiliate2.module).
Also, when I go to update.php there are not updates listed to be run for uc_affiliate2, and the user_commision table does not exist in my database. This error causes a sitewide failure of my website.
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | 1376108-missing-table.patch | 593 bytes | dgtlmoon |
Comments
Comment #1
nohup commentedDid you update to the latest version of uc_affiliate2 6.x before updating from 6.x to 7.x? uc_affiliate2_user_commission should be there in 6.x.
Comment #2
AlanT commentedI'm running into a similar issue. I've upgraded everything else from D6 to D7, but when I activate the UC_Affiliate2 module, I get "The website encountered an unexpected error. Please try again later. " messages, preventing the site from being seen.
When I deactivate the module by going into the database, I can then see the watchdog log, which says:
Before upgrading, the D6 version of all modules were up-to-date (Ubercart Affiliate v2 6.x-2.6), and I do not have uc_affiliate2_user_commission table in the database. I have uc_affiliate2_user and uc_affiliate2_commission tables, though.
In looking through the schema of all D6 versions of this module (including 6.x-2.x-dev and 6.x-3.x-dev) I see no such table as claimed above.
I've run the update.php script even though no updates where indicated. (after re-enabling the module) Same result.
At this point, this is the only thing preventing me from upgrading my site.
Thanks.
Comment #3
davidarthur commentedI can confirm this issue is present on our upgrade, the table never exists in the d6 version and is not created in the upgrade process.
Comment #4
duckzland commentedI had to make a hook_update_N to force create the missing table, This shouldn't be considered as a proper fix. just a quick hack to make things work.
note: append the code to uc_affiliate2.install file
Comment #5
interestingaftermath commentedThanks #4! Worked perfectly.
Comment #6
dgtlmoon commentedWorked for me too, looks like the original update hooks for the D7 version dont deal with this at all
Comment #7
dgtlmoon commentedComment #8
dgtlmoon commentednot sure if this is the right approach, but here's a patch anyway