Yaron Koren has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/404599 )
Change subject: Added <page name> option for "create/edit title" ...................................................................... Added <page name> option for "create/edit title" Change-Id: I62c91907f8862faaa2b0da1e367e209c0e4e1a92 --- M includes/PF_AutoeditAPI.php M specials/PF_FormEdit.php 2 files changed, 7 insertions(+), 7 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PageForms refs/changes/99/404599/2 diff --git a/includes/PF_AutoeditAPI.php b/includes/PF_AutoeditAPI.php index 09ec5ec..a403101 100644 --- a/includes/PF_AutoeditAPI.php +++ b/includes/PF_AutoeditAPI.php @@ -912,8 +912,7 @@ $wgRequest = $oldRequest; if ( $generatedFormName !== '' ) { - $formTitle = Title::newFromText( $generatedFormName ); - $this->mOptions['formtitle'] = $formTitle->getText(); + $this->mOptions['formtitle'] = $generatedFormName; } $this->mOptions['formHTML'] = $formHTML; diff --git a/specials/PF_FormEdit.php b/specials/PF_FormEdit.php index 7b29736..44858f7 100644 --- a/specials/PF_FormEdit.php +++ b/specials/PF_FormEdit.php @@ -126,17 +126,18 @@ $targetTitle = Title::newFromText( $result[ 'target' ] ); // Set page title depending on whether an explicit title was - // specified in the form definition. + // specified in the form definition, and whether this is a + // new or existing page being edited. if ( array_key_exists( 'formtitle', $result ) ) { - // set page title depending on whether the target page exists + $pageTitle = $result[ 'formtitle' ]; if ( empty( $targetName ) ) { - $pageTitle = $result[ 'formtitle' ]; + // This is a new page - we're done. + } elseif ( strpos( $pageTitle, '<page name>' ) !== false ) { + $pageTitle = str_replace( '<page name>', $targetName, $pageTitle ); } else { $pageTitle = $result[ 'formtitle' ] . ': ' . $targetName; } } elseif ( $result[ 'form' ] !== '' ) { - // Set page title depending on whether the target page - // exists. if ( empty( $targetName ) ) { $pageTitle = wfMessage( 'pf_formedit_createtitlenotarget', $result[ 'form' ] )->text(); } elseif ( $targetTitle->exists() ) { -- To view, visit https://gerrit.wikimedia.org/r/404599 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I62c91907f8862faaa2b0da1e367e209c0e4e1a92 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/PageForms Gerrit-Branch: master Gerrit-Owner: Yaron Koren <yaro...@gmail.com> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits