Index: trunk/extensions/EducationProgram/actions/EPEditAction.php |
— | — | @@ -36,7 +36,6 @@ |
37 | 37 | $this->getOutput()->addModules( 'ep.formpage' ); |
38 | 38 | |
39 | 39 | if ( $this->getRequest()->wasPosted() && $this->getUser()->matchEditToken( $this->getRequest()->getVal( 'wpEditToken' ) ) ) { |
40 | | - |
41 | 40 | $this->showForm(); |
42 | 41 | } |
43 | 42 | else { |
— | — | @@ -69,19 +68,24 @@ |
70 | 69 | $data = $this->getNewData(); |
71 | 70 | |
72 | 71 | $object = $c::selectRow( null, $data ); |
73 | | - |
74 | | - if ( $object === false ) { |
75 | | - $this->isNew = true; |
76 | | - $object = new $c( $data, true ); |
| 72 | + |
| 73 | + if ( $object !== false && $this->getRequest()->getText( 'redlink' ) === '1' ) { |
| 74 | + $this->getOutput()->redirect( $this->getTitle()->getLocalURL() ); |
77 | 75 | } |
78 | | - elseif ( $this->isNewPost() ) { |
79 | | - $this->showWarning( wfMessage( 'educationprogram-' . strtolower( $this->getName() ) . '-exists-already' ) ); |
| 76 | + else { |
| 77 | + if ( $object === false ) { |
| 78 | + $this->isNew = true; |
| 79 | + $object = new $c( $data, true ); |
| 80 | + } |
| 81 | + elseif ( $this->isNewPost() ) { |
| 82 | + $this->showWarning( wfMessage( 'educationprogram-' . strtolower( $this->getName() ) . '-exists-already' ) ); |
| 83 | + } |
| 84 | + |
| 85 | + $this->getOutput()->setSubtitle( $this->getDescription() ); |
| 86 | + |
| 87 | + $this->item = $object; |
| 88 | + $this->showForm(); |
80 | 89 | } |
81 | | - |
82 | | - $this->getOutput()->setSubtitle( $this->getDescription() ); |
83 | | - |
84 | | - $this->item = $object; |
85 | | - $this->showForm(); |
86 | 90 | } |
87 | 91 | |
88 | 92 | /** |