Page MenuHomePhabricator

ImportFreeImages incompatible with 1.16
Closed, ResolvedPublic

Description

Author: dasch

Description:
The extension is broken with MW-1.16 when trying to import an image I get this error

Fatal error: Cannot use object of type WebRequest as array in /.../httpdocs/includes/specials/SpecialUpload.php on line 709


Version: unspecified
Severity: major

Details

Reference
bz22012

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:51 PM
bzimport set Reference to bz22012.

dasch wrote:

Well I search a bit in the code and discovered that UploadForm from SpecialUpload.php is called with wgRequest in ImportFreeImages.body.php in line 312

$u = new UploadForm($wgRequest);

but in SpecialUpload.php there is an array with options wanted from line 694

class UploadForm extends HTMLForm {
protected $mWatch;
protected $mForReUpload;
protected $mSessionKey;
protected $mHideIgnoreWarning;
protected $mDestWarningAck;

protected $mTextTop;
protected $mTextAfterSummary;

protected $mSourceIds;

public function __construct( $options = array() ) {
...

(In reply to comment #1)

Well I search a bit in the code and discovered that UploadForm from
SpecialUpload.php is called with wgRequest in ImportFreeImages.body.php in line
312

$u = new UploadForm($wgRequest);

but in SpecialUpload.php there is an array with options wanted from line 694

public function __construct( $options = array() ) {

...

Try $wgRequest->getValues(), that may work.

dasch wrote:

well that's not enough, there are severel other functions from SpecialUpload that where removed and where used by ImportFreeImages

Bryan.TongMinh wrote:

The upload code was rewritten in 1.16, which unfortunately means that ImportFreeImages is incompatible with it.

dasch wrote:

Well that is what this bug is about

After changing $wgRequest to $wgRequest->getValues() another error occures

Fatal error: Call to undefined method UploadForm::execute() in /.../httpdocs/extensions/ImportFreeImages/ImportFreeImages.body.php on line 348

dasch wrote:

Can anybody provide a solution for this problem? I already wrote a mail to the developer but I didn't get an answer. I saw that wikia is using this extension and thought that it will be maintained well. Is there any chance to get this extension to work with MW 1.16?

dasch wrote:

anybody working on this or having the purpose to work on this?

Bryan.TongMinh wrote:

Looks like an interesting project, I might take it in the future.

travis wrote:

Fixed with revision 61372.

Thanks.