Foxtrott has uploaded a new change for review.
https://gerrit.wikimedia.org/r/61815
Change subject: fix bug 47150 (sfEditFormPreloadText no longer works as it used
to)
......................................................................
fix bug 47150 (sfEditFormPreloadText no longer works as it used to)
The hook was only called if a valid preload page was specified.
It is now called in all cases where preloading is not explicitly excluded.
Change-Id: I080bd4473635c26e8a8b853d5272f892ed00b639
---
M includes/SF_AutoeditAPI.php
1 file changed, 9 insertions(+), 4 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SemanticForms
refs/changes/15/61815/1
diff --git a/includes/SF_AutoeditAPI.php b/includes/SF_AutoeditAPI.php
index da7dafa..15429ae 100644
--- a/includes/SF_AutoeditAPI.php
+++ b/includes/SF_AutoeditAPI.php
@@ -770,19 +770,24 @@
// preload data if not explicitly excluded and if the preload
page exists
if ( !isset( $this->mOptions[ 'preload' ] ) || $this->mOptions[
'preload' ] !== false ) {
- if ( !isset( $this->mOptions[ 'preload' ] ) ||
$this->mOptions[ 'preload' ] === true ) {
- $preloadTitle = Title::newFromText( $targetName
);
- } else {
+ if ( isset( $this->mOptions[ 'preload' ] ) &&
is_string( $this->mOptions[ 'preload' ] ) ) {
$preloadTitle = Title::newFromText(
$this->mOptions[ 'preload' ] );
+ } else {
+ $preloadTitle = Title::newFromText( $targetName
);
}
if ( $preloadTitle !== null && $preloadTitle->exists()
) {
// the content of the page that was specified
to be used for preloading
$preloadContent = WikiPage::factory(
$preloadTitle )->getRawText();
+ } else {
+ $preloadContent = null;
+ }
- wfRunHooks( 'sfEditFormPreloadText', array(
&$preloadContent, $targetTitle, $formTitle ) );
+ wfRunHooks( 'sfEditFormPreloadText', array(
&$preloadContent, $targetTitle, $formTitle ) );
+ if ( $preloadContent !== null ) {
+
$pageExists = true;
// spoof $wgRequest for SFFormPrinter::formHTML
--
To view, visit https://gerrit.wikimedia.org/r/61815
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I080bd4473635c26e8a8b853d5272f892ed00b639
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SemanticForms
Gerrit-Branch: master
Gerrit-Owner: Foxtrott <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits