Hi folks,
I'm trying to upgrade a site running Drupal 4.6.7 to Drupal 4.7.3 and am having some issues, specifically with version history on nodes.
Looking through the source, I see that most of my problems are in system_update_159(). The first problem is that, in system_update_158(), the following query is executed:
ALTER TABLE {old_revisions} ADD done tinyint(1) NOT NULL DEFAULT 0
Then, in system_update_159(), this is run:
SELECT * FROM {old_revisions} WHERE done = 1 AND type IN ('page', 'story', 'poll', 'book', 'forum', 'blog') ORDER BY nid DESC
Since, at no point in the code, is old_revisions.done actually set to 1, no rows are returned from the second query, and no revisions are copied over.
In the process of my troubleshooting, I tried removing "done = 1" from the second query, and had my second problem, which is that some nodes are not converted for whatever reason. I see errors like this in my log:
Recovering old revisions for node 41 failed.
Recovering old revisions for node 43 failed.
Recovering old revisions for node 83 failed.
Recovering old revisions for node 41 failed.
Recovering old revisions for node 43 failed.
Recovering old revisions for node 83 failed.
Note the duplicate entries there. Further examine reveals that there is a line which reads as:
if (isset($revisions) && is_array($revisions) && count($revisions) > 0) {