Index: trunk/phase3/includes/filerepo/OldLocalFile.php |
— | — | @@ -30,14 +30,12 @@ |
31 | 31 | } |
32 | 32 | |
33 | 33 | static function newFromKey( $sha1, $repo, $timestamp = false ) { |
34 | | - # Polymorphic function name to distinguish foreign and local fetches |
35 | | - $fname = get_class( $this ) . '::' . __FUNCTION__; |
36 | | - |
37 | 34 | $conds = array( 'oi_sha1' => $sha1 ); |
38 | 35 | if( $timestamp ) { |
39 | 36 | $conds['oi_timestamp'] = $timestamp; |
40 | 37 | } |
41 | | - $row = $dbr->selectRow( 'oldimage', $this->getCacheFields( 'oi_' ), $conds, $fname ); |
| 38 | + $dbr = $repo->getSlaveDB(); |
| 39 | + $row = $dbr->selectRow( 'oldimage', self::selectFields(), $conds, __METHOD__ ); |
42 | 40 | if( $row ) { |
43 | 41 | return self::newFromRow( $row, $repo ); |
44 | 42 | } else { |
Index: trunk/phase3/includes/filerepo/LocalFile.php |
— | — | @@ -79,14 +79,12 @@ |
80 | 80 | * Do not call this except from inside a repo class. |
81 | 81 | */ |
82 | 82 | static function newFromKey( $sha1, $repo, $timestamp = false ) { |
83 | | - # Polymorphic function name to distinguish foreign and local fetches |
84 | | - $fname = get_class( $this ) . '::' . __FUNCTION__; |
85 | | - |
86 | 83 | $conds = array( 'img_sha1' => $sha1 ); |
87 | 84 | if( $timestamp ) { |
88 | 85 | $conds['img_timestamp'] = $timestamp; |
89 | 86 | } |
90 | | - $row = $dbr->selectRow( 'image', $this->getCacheFields( 'img_' ), $conds, $fname ); |
| 87 | + $dbr = $repo->getSlaveDB(); |
| 88 | + $row = $dbr->selectRow( 'image', self::selectFields(), $conds, __METHOD__ ); |
91 | 89 | if( $row ) { |
92 | 90 | return self::newFromRow( $row, $repo ); |
93 | 91 | } else { |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -247,6 +247,8 @@ |
248 | 248 | * (bug 23293) Do not show change tags when special:recentchanges(linked) |
249 | 249 | or special:newpages is transcluded into another page as it messes up the |
250 | 250 | page. |
| 251 | +* (bug 24517) LocalFile::newFromKey() and OldLocalFile::newFromKey() no longer |
| 252 | + throw fatal errors |
251 | 253 | |
252 | 254 | === API changes in 1.17 === |
253 | 255 | * (bug 22738) Allow filtering by action type on query=logevent. |