Fix regression causing incorrect image data to be stored in the oldimage table.
authorBrion Vibber <brion@users.mediawiki.org>
Fri, 4 May 2007 19:39:19 +0000 (19:39 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Fri, 4 May 2007 19:39:19 +0000 (19:39 +0000)
commit67c4772b6751b9b03fbd5375351a531c2f4dd9f7
treeff054b3746e4ac52ed96c664a0d76fd4b0eba341
parent62c20a75639c15bd6c32c46c17c104b601445371
Fix regression causing incorrect image data to be stored in the oldimage table.
The call to upgradeRow() in purgeMetadataCache(), indirectly called during upload, caused data for the new file to be written into the 'image' table in the database before migration from 'image' to 'oldimage'. Thus data for the new file was recorded as belonging to the old file.
Have replaced this call with a call to loadFromFile(), so the new data goes only into cache
at this time, and won't get written to the database until after.
The 'purge' action in ImagePage now explicitly calls the upgradeRow() function in addition to cache purging... is it needed elsewhere?
This whole mess still stinks of race  conditions, though. Sigh.
includes/Image.php
includes/ImagePage.php