Index: trunk/extensions/SemanticForms/specials/SF_FormStart.php |
— | — | @@ -71,7 +71,7 @@ |
72 | 72 | if ( $page_name !== '' ) { |
73 | 73 | // Append the namespace prefix to the page name, |
74 | 74 | // if this namespace was not already entered. |
75 | | - if ( strpos( $page_name, $target_namespace . ':' ) === false && $target_namespace !== '' ) |
| 75 | + if ( strpos( $page_name, $target_namespace . ':' ) === false && !is_null( $target_namespace ) ) |
76 | 76 | $page_name = $target_namespace . ':' . $page_name; |
77 | 77 | // If there was no page title, it's probably an |
78 | 78 | // invalid page name, containing forbidden |
— | — | @@ -122,9 +122,8 @@ |
123 | 123 | /** |
124 | 124 | * Helper function - returns a URL that includes Special:FormEdit. |
125 | 125 | */ |
126 | | - static function getFormEditURL( $formName, $targetTitle) { |
| 126 | + static function getFormEditURL( $formName, $targetName) { |
127 | 127 | $fe = SpecialPage::getPage( 'FormEdit' ); |
128 | | - $targetName = SFUtils::titleURLString( $targetTitle ); |
129 | 128 | // Special handling for forms whose name contains a slash. |
130 | 129 | if ( strpos( $formName, '/' ) !== false ) { |
131 | 130 | return $fe->getTitle()->getLocalURL( array( 'form' => $formName, 'target' => $targetName ) ); |
— | — | @@ -144,10 +143,11 @@ |
145 | 144 | $redirect_title = Title::newFromRedirect( $article->fetchContent() ); |
146 | 145 | if ( $redirect_title != null ) { |
147 | 146 | $page_title = $redirect_title; |
| 147 | + $page_name = SFUtils::titleURLString( $redirect_title ); |
148 | 148 | } |
149 | 149 | // HACK - if this is the default form for |
150 | 150 | // this page, send to the regular 'formedit' |
151 | | - // tab page; otherwise, send to the 'Special:EditData' |
| 151 | + // tab page; otherwise, send to the 'Special:FormEdit' |
152 | 152 | // page, with the form name hardcoded. |
153 | 153 | // Is this logic necessary? Or should we just |
154 | 154 | // out-guess the user and always send to the |
— | — | @@ -160,10 +160,10 @@ |
161 | 161 | if ( $form_name == $default_form_name ) { |
162 | 162 | $redirect_url = $page_title->getLocalURL( 'action=formedit' ); |
163 | 163 | } else { |
164 | | - $redirect_url = self::getFormEditURL( $form_name, $page_title ); |
| 164 | + $redirect_url = self::getFormEditURL( $form_name, $page_name ); |
165 | 165 | } |
166 | 166 | } else { |
167 | | - $redirect_url = self::getFormEditURL( $form_name, $page_title ); |
| 167 | + $redirect_url = self::getFormEditURL( $form_name, $page_name ); |
168 | 168 | // Of all the request values, send on to 'FormEdit' |
169 | 169 | // only 'preload' and specific form fields - we can |
170 | 170 | // identify the latter because they show up as arrays. |