Starting with Drupal 5.15 and biblio 5.x-1.16 i update to Drupal 6.9.
Then biblio to 6.x-1.0-rc4.
The update log notes: "Failed: Moved authors from 0 / 230 publications to the new database stucture". (full log attached)

All the papers on the publication page then have no author names anymore.

Any ideas as to what's going on here? Do i have to use one of the betas in between?

Many Thanks.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

rjerome’s picture

Going from 5.x to 6.x-1.0-rc4 should work (I've tested it numerous times) The question here is why it didn't move any of your authors? Please tell me you make a backup first, otherwise your in big trouble :-(

Assuming you did make a backup of your database, and are willing to send it to me I could take a look. Contact me via my contact page if you would like to do this.

matze_’s picture

I'm testing with a copy of the site in xampp (windows, Apache/2.2.11, MySQL/5.1.30, PHP/5.2.8).
The production server is linux (Apache/2.2.6, MySQL/5.0.45, PHP/5.2.4)
Any incompatibilities here?
Not going to do this on the production site until it works.

Thank you for your offer. Would it be enough just to export all biblio* tables? The whole db would be quite big.

rjerome’s picture

I would also need the corresponding entries from node and node_revisions where type == 'biblio'

P.S. I develop on both WAMP and LAMP so I don't think that's an issue.

rjerome’s picture

Just for the public record... I got a copy of Matthias's database and was able to update it on my system without issue, so further investigation on his end is in order.

matze_’s picture

Thank you Ron. I'll try again on a linux box this weekend.

rjerome’s picture

The one other thing I though of was that the update is renaming one of the tables, and perhaps your account didn't have the privilege to do that. In looking at the code, that particular action would not have generated an error either since I forgot to collect the results from the command. If you want to test the theory, edit the biblio.install file and go the biblio_update_6000() function. In that function about 7 lines from the beginning you will see some code like this...

  // move biblio_fields to biblio_fields_old for later usage
  update_sql("ALTER TABLE {biblio_fields} RENAME TO {biblio_fields_old}");
  update_sql("UPDATE {biblio_fields_old} SET name='biblio_corp_authors' WHERE name='biblio_corp_author'");

CHANGE IT TO THIS...

  // move biblio_fields to biblio_fields_old for later usage
   $result[] = update_sql("ALTER TABLE {biblio_fields} RENAME TO {biblio_fields_old}");
   $result[] = update_sql("UPDATE {biblio_fields_old} SET name='biblio_corp_authors' WHERE name='biblio_corp_author'");

The try the update again. If it generates errors trying to rename that table then I think we found the problem.

Ron.

matze_’s picture

I tried it on my laptop (lighttpd/1.4.19, MySQL/5.0.67, PHP/5.2.6) with the same failure.

The db user has all the privileges, ...

$result[] = update_sql("ALTER TABLE {biblio_fields} RENAME TO {biblio_fields_old}");
 $result[] = update_sql("UPDATE {biblio_fields_old} SET name='biblio_corp_authors' WHERE name='biblio_corp_author'");

that worked.

I'll try to put some more verbose logging in _move_authors(). See if i can chase it down.

rjerome’s picture

That would be great it you could track that one down. It's a little troubling that it's not reproducible, and I'm hesitant to make a final release if this potentially serious problem is still looming.

Ron.

matze_’s picture

So far, _move_authors() calls _save_contributors() in biblio.contributors.inc and then drupal_write_record(). This is where it breaks, biblio.contributors.inc, line 107 (in rc5):
if (!drupal_write_record('biblio_contributor_data', $author)) return false;
This always returns false. I don't know why yet.

rjerome’s picture

You might want to check the contents of $author before the attempt to write the record. The only reason it would fail is if $author doesn't contain any keys which match the column names in biblio_contributor_data, there is an existing record with the same primary key or it simply can't write to that table. Is there anything in that table (biblio_contributor_data)?

Ron.

matze_’s picture

Got it working!

Here is what i used to do all the time:
- copy new biblio module to modules/biblio/
- go to update.php
=>fails

Here is how it works:
- load module page where it says 'This version is incompatible with the 6.9 version of Drupal core.'
- copy new biblio module to modules/biblio/
- reload module page where now the biblio is there but not enabled
- enable module and save configuration
- then run update.php

So the module has to be enabled before running update.php. Thats all. So simple.

matze_’s picture

Status: Active » Closed (fixed)
rjerome’s picture

Status: Closed (fixed) » Fixed

FYI, I changed the install code so that even if the module is disabled author information will not be lost.

Ron.

Status: Fixed » Closed (fixed)

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