Index: trunk/extensions/RecordAdmin/RecordAdmin_body.php |
— | — | @@ -37,17 +37,25 @@ |
38 | 38 | $wgParser->setFunctionHook( $wgRecordAdminTableMagic, array( $this, 'expandTableMagic' ) ); |
39 | 39 | $wgParser->setFunctionHook( $wgRecordAdminDataMagic, array( $this, 'expandDataMagic' ) ); |
40 | 40 | |
41 | | - # Check if posting a public creation form |
42 | | - $title = Title::newFromText( $wgRequest->getText( 'title' ) ); |
43 | | - if ( is_object( $title ) && $title->getNamespace() != NS_SPECIAL && $wgRequest->getText( 'wpType' ) && $wgRequest->getText( 'wpCreate' ) ) |
44 | | - $this->createRecord(); |
45 | | - |
46 | 41 | # A minimal hook so we know if the page has been rendered or not |
47 | 42 | # (so that record tables don't execute when run from the job-queue - looking for a better way to do this) |
48 | 43 | $wgHooks['BeforePageDisplay'][] = $this; |
49 | 44 | |
50 | | - # Add some hooks if the current title is a record |
| 45 | + # Get the current title accounting for redirect |
| 46 | + $title = Title::newFromText( $wgRequest->getText( 'title' ) ); |
| 47 | + if ( is_object( $title ) && $title->isRedirect() ) { |
| 48 | + $article = new Article( $title ); |
| 49 | + $content = $article->getContent(); |
| 50 | + if ( preg_match( '/\[\[(.+?)\]\]/', $content, $m ) ) $title = Title::newFromText( $m[1] ); |
| 51 | + } |
| 52 | + |
51 | 53 | if ( is_object( $title ) ) { |
| 54 | + |
| 55 | + # Check if posting a public creation form |
| 56 | + if ( $title->getNamespace() != NS_SPECIAL && $wgRequest->getText( 'wpType' ) && $wgRequest->getText( 'wpCreate' ) ) |
| 57 | + $this->createRecord(); |
| 58 | + |
| 59 | + # Add some hooks if the current title is a record |
52 | 60 | $uses = ''; |
53 | 61 | $id = $title->getArticleID(); |
54 | 62 | $dbr = &wfGetDB( DB_SLAVE ); |
Index: trunk/extensions/RecordAdmin/RecordAdmin.php |
— | — | @@ -11,7 +11,7 @@ |
12 | 12 | * @licence GNU General Public Licence 2.0 or later |
13 | 13 | */ |
14 | 14 | |
15 | | -define( 'RECORDADMIN_VERSION', '0.10.4, 2010-02-13' ); |
| 15 | +define( 'RECORDADMIN_VERSION', '0.10.6, 2010-02-15' ); |
16 | 16 | |
17 | 17 | $wgRecordAdminUseNamespaces = false; # Whether record articles should be in a namespace of the same name as their type |
18 | 18 | $wgRecordAdminCategory = 'Records'; # Category containing record types |