A major reason, why I not yet migrated to D6 is that the update process of the biblio module didn't work satisfactorily. Much of my previous customized configuration was lost. I looked for quite a while into the update functions in biblio_install and found the reason:
While the config is updated in 6000 using the old fids (including 2,3,4 for secondary, tertiary authors etc.) you remove the complete biblio_fields table in 6008, rebuilding it from scratch using the csv files. However, this has shifted all fids, removing those for secondary authors. Hence the new fids do not match the data in biblio_field_type anymore. I guess you have a quite complicated update process. I've chosen a very simple solution: rewriting the update code from scratch, summarizing all updates from 6000-6010 into 6000. Although I'm quite confident, that the update path from 5.x works nice now, I'm not sure whether the update from some early 6.x betas is broken now...
Nevertheless for your information, the appropriate patch is attached.

Robert

Comments

rjerome’s picture

Thanks Robert,

This is why it's good to have more than one set of eyes on the code. I have to admit that I never even noticed that I was blowing that table with the old data in it. I'll see what effect this has on the beta versions.

Ron.

rjerome’s picture

Robert,

I tested your patch and it works great. I must say you've raised the SQL bar pretty high with things like this...

 update_sql("UPDATE {biblio_contributor} c 
		INNER JOIN {biblio} b ON c.nid=b.nid AND c.vid=b.vid
		INNER JOIN (SELECT tid,if(fid=4,5,fid) as auth_type,title FROM
		  (SELECT tid,fid,title FROM {biblio_type_details} WHERE fid<=4
 			 UNION SELECT tid,fid,title FROM {biblio_fields_old}, {biblio_types} WHERE fid<=4 AND tid>=100) t
	    GROUP BY tid,fid) otd ON otd.tid=b.biblio_type AND otd.auth_type=c.auth_type
		INNER JOIN {biblio_contributor_type_data} ctd ON ctd.title=otd.title
		SET c.auth_type=ctd.auth_type");

I'm still trying to decipher it.

rhaschke’s picture

StatusFileSize
new15.34 KB

I like the strength of SQL ;-)
In the attached patch I added some more comments to explain the sub queries. Hopefully this eases understanding.

rhaschke’s picture

StatusFileSize
new4.87 KB

I just have seen, that you already integrated my install patch into the CVS HEAD. So here is a patch containing the additional comments, which works against the current CVS HEAD.

rjerome’s picture

Status: Needs review » Fixed

Applied patch in #4.

Status: Fixed » Closed (fixed)

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