[prev in list] [next in list] [prev in thread] [next in thread] 

List:       wikitech-l
Subject:    Re: [Wikitech-l] SpecialUpload: why is the output of showSuccess()
From:       "Travis Derouin" <travis () wikihow ! com>
Date:       2007-03-27 17:58:35
Message-ID: d45df5100703271058y6c842f7fneade4d1c4752361e () mail ! gmail ! com
[Download RAW message or body]

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
>

_______________________________________________
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
http://lists.wikimedia.org/mailman/listinfo/wikitech-l
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic