I have run into a problem trying to update a D6 site to D7. I have successfully updated all core modules without errors, and have a running installation. I previously had mollom running on the old site, and have the authorization key configured properly. The mollom module is enabled as well as dependent modules. The update script generates the following error:
Failed: PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'quality' in 'where clause': UPDATE {mollom} SET quality=:db_update_placeholder_0 WHERE (quality = :db_condition_placeholder_0) ; Array ( [:db_update_placeholder_0] => 9 [:db_condition_placeholder_0] => ) in mollom_update_7005() (line 564 of /home/pfloggin/domains/test.pflogging.com/public_html/sites/all/modules/mollom/mollom.install).
The fix seems to be attempting to 'Clean up and complete server response columns in {mollom}', but I know how messy such upgrade paths can be. My mollom table has a 'quality_score' field, but no quality field.
Attempts to configure mollom in spite of this error do not work. Any suggestions on how to proceed?
Thanks for your help.
| Comment | File | Size | Author |
|---|---|---|---|
| #24 | mollom.install.patch | 10.31 KB | dgrant |
Comments
Comment #1
sunAm I guessing right that you previously had 6.x-2.x installed? (and not 6.x-1.x?)
i.e., upgrading from 6.x-2.x to 7.x-2.x?
Comment #2
sunSorry, without further information this issue can only be closed as not reproducible.
Feel free to re-open this issue if you want to provide further information. Thanks.
Comment #2.0
sunUpdated to reflect examination of database.
Comment #3
dgrant commentedComment #4
dgrant commentedThe problem is in update 7005:
// Add {mollom}.spam. // When upgrading from 6.x-2.x, this is {mollom}.spamScore already. if (!db_field_exists('mollom', 'spam') && !db_field_exists('mollom', 'spamScore')) { db_add_field('mollom', 'spam', array( 'description' => 'Text analysis spam check result.', 'type' => 'int', 'size' => 'tiny', 'not null' => FALSE, )); // Fill {mollom}.spam with approximate values based on {mollom}.quality. // Note that this is just to have some values. 'quality' and 'spam' are // completely unrelated otherwise. // MOLLOM_ANALYSIS_SPAM (2) db_update('mollom') ->fields(array('spam' => 2)) ->condition('quality', 0.5, '<') ->execute(); // MOLLOM_ANALYSIS_UNSURE (3) db_update('mollom') ->fields(array('spam' => 3)) ->condition('quality', 0.5, '=') ->execute(); // MOLLOM_ANALYSIS_HAM (1) db_update('mollom') ->fields(array('spam' => 1)) ->condition('quality', 0.5, '>') ->execute(); }The condition('quality') fails because there is no quality field, it is now qualityScore (since update 6200).
Comment #5
dgrant commentedpatch attached, tested and it works.
Comment #6
dgrant commentedThere is another bug during upgrade, update 7008 fails. Patch coming.
Comment #7
dgrant commentedNew patch. Lots more issues with 6->7 upgrade fixed.
Comment #8
dgrant commentedComment #9
dgrant commentedNot sure why this wasn't a bug report.
Comment #10
TonyBy commentedAs at #6 'update 7008' was failing so installed patch at #7. This got me a lot further, instead of 18 pending updates for mollom it went down to 1 but this one keeps failing:
Comment #11
eshta commentedIt seems like a lot of this patch and some of the problems are based on updates being run multiple times. There are some field names that get renamed and the re-runs already have those fields renamed.
Comment #12
dgrant commentedYep, the problems are based on the fact that the mollom 6.x latest will give you update 6212 which renames all the fields to use underscores instead of camelcase. This causes many of the 7xxx series patches to fail.
TonyBy, I'm not sure why you would still have a spamScore column and a spam_score column. I will add some extra code to my patch to cover the corner case you seem to have found yourself in.
Comment #13
TonyBy commentedI dropped the old named duplicate fields that had caused the error.
Then I renamed the following 4 fields in the 'mollom' table with what update 7213 expected to find:
'spam_score' became 'spamScore',
'spam_classification' became 'spamClassification',
'quality_score' became 'qualityScore',
'profanity_score' became 'profanityScore',
Then I ran update.php. It completed without error.
I also had to drop the spurious ‘profanity’ field. Don’t know where that came from.
I enabled the module and can visit its configuration page with problems.
Comment #14
dgrant commentedTonyBy, you mean "without problems"?
Submitting updated patch now.
Comment #15
dgrant commentedLatest patch. Updates some of the comments and does more paranoid checking before changing or adding columns.
Comment #16
dgrant commentedComment #17
dgrant commentedTested and works for me with 6.x (latest release) -> 7.x (latest release) upgrade
Comment #18
eshta commentedLet's also add a check for db_index_exists before dropping for both content and captcha ids. This should have been included the first time around as it is. Other than that it looks pretty good to me.
Comment #19
dgrant commentedComment #20
dgrant commentedMost recent patch updated. Please test and/or commit.
Comment #21
dgrant commentedI incorporated eshta's feedback. Thanks.
Comment #22
eshta commentedGo testbots!
Comment #24
dgrant commentedFixed paths in patch.
Comment #25
eshta commentedSetting status back to "Needs review" to run the test bots :-)
Comment #26
dgrant commentedIs the patch good to put the -dev version or something now? Thanks.
Comment #27
dgrant commentedHas this been committed yet?
Comment #28
dgrant commentedHas this been committed yet?
Comment #30
eshta commentedSo sorry for the silence there. I was battling an issue with the 7.x-2.x branch that was causing test failures for all submitted patches. That has been fixed - and now this has been committed. Thanks for your work :-)