Index: trunk/phase3/includes/filerepo/LocalFile.php |
— | — | @@ -807,12 +807,12 @@ |
808 | 808 | $props['timestamp'] = wfTimestamp( TS_MW ); |
809 | 809 | $this->setProps( $props ); |
810 | 810 | |
811 | | - // Delete thumbnails and refresh the metadata cache |
| 811 | + # Delete thumbnails |
812 | 812 | $this->purgeThumbnails(); |
813 | | - $this->saveToCache(); |
| 813 | + # The file is already on its final location, remove it from the squid cache |
814 | 814 | SquidUpdate::purge( array( $this->getURL() ) ); |
815 | 815 | |
816 | | - // Fail now if the file isn't there |
| 816 | + # Fail now if the file isn't there |
817 | 817 | if ( !$this->fileExists ) { |
818 | 818 | wfDebug( __METHOD__ . ": File " . $this->getPath() . " went missing!\n" ); |
819 | 819 | return false; |
— | — | @@ -922,8 +922,9 @@ |
923 | 923 | $descTitle->invalidateCache(); |
924 | 924 | $descTitle->purgeSquid(); |
925 | 925 | } else { |
926 | | - // New file; create the description page. |
927 | | - // There's already a log entry, so don't make a second RC entry |
| 926 | + # New file; create the description page. |
| 927 | + # There's already a log entry, so don't make a second RC entry |
| 928 | + # Squid and file cache for the description page are purged by doEdit. |
928 | 929 | $article->doEdit( $pageText, $comment, EDIT_NEW | EDIT_SUPPRESS_RC ); |
929 | 930 | } |
930 | 931 | |
— | — | @@ -934,6 +935,12 @@ |
935 | 936 | # The most important thing is that files don't get lost, especially archives |
936 | 937 | $dbw->commit(); |
937 | 938 | |
| 939 | + # Save to cache and purge the squid |
| 940 | + # We shall not saveToCache before the commit since otherwise |
| 941 | + # in case of a rollback there is an usable file from memcached |
| 942 | + # which in fact doesn't really exist (bug 24978) |
| 943 | + $this->saveToCache(); |
| 944 | + |
938 | 945 | # Invalidate cache for all pages using this file |
939 | 946 | $update = new HTMLCacheUpdate( $this->getTitle(), 'imagelinks' ); |
940 | 947 | $update->doUpdate(); |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -309,6 +309,7 @@ |
310 | 310 | * Disable multithreaded behaviour in recent ImageMagick, to avoid a deadlock |
311 | 311 | when a resource limit such as $wgMaxShellMemory is hit. |
312 | 312 | * (bug 24981) Allow extensions to access SpecialUpload variables again |
| 313 | +* (bug 20744) Wiki forgets about an uploaded file |
313 | 314 | |
314 | 315 | === API changes in 1.17 === |
315 | 316 | * (bug 22738) Allow filtering by action type on query=logevent. |