Index: trunk/extensions/SemanticForms/includes/SF_FormPrinter.php |
— | — | @@ -366,6 +366,8 @@ |
367 | 367 | // just use the name of the actual page we're on. |
368 | 368 | global $wgTitle; |
369 | 369 | $this->mPageTitle = $wgTitle; |
| 370 | + } elseif ( $is_query ) { |
| 371 | + $this->mPageTitle = Title::newFromText( 'RunQuery dummy title' ); |
370 | 372 | } elseif ( $page_name === '' ) { |
371 | 373 | $this->mPageTitle = Title::newFromText( |
372 | 374 | $wgRequest->getVal( 'namespace' ) . ":Semantic Forms permissions test" ); |
— | — | @@ -383,10 +385,12 @@ |
384 | 386 | // "$wgEmailConfirmToEdit = true;". Instead, we'll just get the |
385 | 387 | // permission errors from the start, and use those to determine whether |
386 | 388 | // the page is editable. |
387 | | - //$userCanEditPage = ( $wgUser->isAllowed( 'edit' ) && $this->mPageTitle->userCan( 'edit' ) ); |
388 | | - $permissionErrors = $this->mPageTitle->getUserPermissionsErrors( 'edit', $wgUser ); |
389 | | - $userCanEditPage = count( $permissionErrors ) == 0; |
390 | | - wfRunHooks( 'sfUserCanEditPage', array( $this->mPageTitle, &$userCanEditPage ) ); |
| 389 | + if ( !$is_query ) { |
| 390 | + //$userCanEditPage = ( $wgUser->isAllowed( 'edit' ) && $this->mPageTitle->userCan( 'edit' ) ); |
| 391 | + $permissionErrors = $this->mPageTitle->getUserPermissionsErrors( 'edit', $wgUser ); |
| 392 | + $userCanEditPage = count( $permissionErrors ) == 0; |
| 393 | + wfRunHooks( 'sfUserCanEditPage', array( $this->mPageTitle, &$userCanEditPage ) ); |
| 394 | + } |
391 | 395 | $form_text = ""; |
392 | 396 | if ( $userCanEditPage || $is_query ) { |
393 | 397 | $form_is_disabled = false; |