I think you have to clear the redirect that updateArticle sets in $wgOut.
$wgOut->redirect(''); // clear the redirect, we want to show a nice page of images
I had to do something like this for the multiupload extension, which may be of some use to you:
http://www.mediawiki.org/wiki/Extension:MultiUpload
On 3/27/07, Andreas R. newsgroups2005@geekmail.de wrote:
I am writing some code that should allow to upload multiple files (from an archive), but for this to work properly showSuccess() should be called always to show those files which succeeded and those that didn't (or produced warnings)... However, in the first case, ie. the last uploaded file didn't exist previously, MediaWiki redirects? / shows the Image:... page of that last file.
However, I cannot see that case (i.e. case 1.) from the code in SpecialUpload.php: In function processUpload() we have function processUpload() { [...] if( $this->saveUploadedFile( $this->mUploadSaveName, $this->mUploadTempName, $hasBeenMunged ) ) { /** * Update the upload log and create the description page * if it's a new file. */ $img = Image::newFromName( $this->mUploadSaveName ); $success = $img->recordUpload( $this->mUploadOldVersion,
$this->mUploadDescription, $this->mLicense,
$this->mUploadCopyStatus, $this->mUploadSource, $this->mWatchthis );
if ( $success ) { $this->showSuccess(); wfRunHooks( 'UploadComplete', array( &$img ) ); } else { // Image::recordUpload() fails if the image
went missing, which is // unlikely, hence the lack of a specialised message $wgOut->showFileNotFoundError( $this->mUploadSaveName ); } } } i.e. either we are successful and call showSuccess() or showFileNotFoundError(..) on failure. I also looked at the called functions, but didn't find any redirects.
So how can I force to save files and also that the output of showSuccess() is always shown? Any hints would be appreciated.
Regards, Andreas
PS: it's a repost (now from gmane web interface) since the original posts obviously didn't make it to the newsgroup, although the automatic registration mail from gmane server said it would be automatically posted after verification of the e-mail address.
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/wikitech-l