Skip to content

Commit

Permalink
fix (uploadForm): fixes #56 upload button error when $wgPageFormsSimp…
Browse files Browse the repository at this point in the history
…leUpload is false
  • Loading branch information
marko220991 committed Apr 11, 2024
1 parent 4ebbdc0 commit 84f9fda
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions specials/PF_UploadForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ class PFUploadForm extends HTMLForm {
/** @var string */
private $mDestFile;

public function __construct( $options = [] ) {
public function __construct( $options = [], IContextSource $context = null ) {
if ( $context instanceof IContextSource ) {
$this->setContext( $context );
}
$this->mWatch = !empty( $options['watch'] );
$this->mForReUpload = !empty( $options['forreupload'] );
$this->mSessionKey = isset( $options['sessionkey'] )
Expand All @@ -41,8 +44,8 @@ public function __construct( $options = [] ) {
+ $this->getDescriptionSection()
+ $this->getOptionsSection();

Hooks::run( 'UploadFormInitDescriptor', [ &$descriptor ] );
parent::__construct( $descriptor, 'upload' );
$this->getHookRunner()->onUploadFormInitDescriptor( $descriptor );
parent::__construct( $descriptor, $this->getContext(), 'upload' );

# Set some form properties
$this->setSubmitText( $this->msg( 'uploadbtn' )->text() );
Expand Down

0 comments on commit 84f9fda

Please sign in to comment.