Index: trunk/extensions/ProofreadPage/ProofreadPage.php |
— | — | @@ -64,10 +64,9 @@ |
65 | 65 | } |
66 | 66 | $dbr->freeResult( $result ) ; |
67 | 67 | |
68 | | - if( !$index_title ) { // there is no index, or no page list in the index |
| 68 | + //if multipage, we use the page order, but we should read pagenum from the index |
| 69 | + if( $image->exists() && $image->isMultiPage() ) { |
69 | 70 | |
70 | | - if( ! ($image->exists() && $image->isMultiPage() ) ) return $err; |
71 | | - |
72 | 71 | $pagenr = 1; |
73 | 72 | $parts = explode( '/', $wgTitle->getText() ); |
74 | 73 | if( count( $parts ) > 1 ) { |
— | — | @@ -80,10 +79,14 @@ |
81 | 80 | $index_name = "$index_namespace:$name"; |
82 | 81 | $prev_name = "$page_namespace:$name/" . ( $pagenr - 1 ); |
83 | 82 | $next_name = "$page_namespace:$name/" . ( $pagenr + 1 ); |
84 | | - $index_title = Title::newFromText( $index_name ); |
85 | 83 | $prev_url = ( $pagenr == 1 ) ? '' : Title::newFromText( $prev_name )->getFullURL(); |
86 | 84 | $next_url = ( $pagenr == $count ) ? '' : Title::newFromText( $next_name )->getFullURL(); |
87 | 85 | $page_num = $pagenr; |
| 86 | + |
| 87 | + if( !$index_title ) { |
| 88 | + //there is no index, or the page is not listed in the index : use canonical index |
| 89 | + $index_title = Title::newFromText( $index_name ); |
| 90 | + } |
88 | 91 | } |
89 | 92 | else { |
90 | 93 | $page_num = ''; |
— | — | @@ -91,6 +94,8 @@ |
92 | 95 | $next_url = ''; |
93 | 96 | } |
94 | 97 | |
| 98 | + |
| 99 | + if( !$index_title ) return $err; |
95 | 100 | $index_url = $index_title->getFullURL(); |
96 | 101 | |
97 | 102 | //if the index page exists, read metadata |