Jump to content
thirty bees forum
  • 0

Can't access the "Custom Payment Methods" module after upgrading from TB 1.5.1 to 1.6.0, getting "500 Server Error" page instead...


Question

Posted (edited)

Hello guys, I had created a "Custom Payment Methods" under Thirtybees 1.5.1 and after upgrading to TB 1.6.0, I can no longer access the "Custom Payment Methods" module using "Modules and Services/Custom Payment Methods" in the Backoffice, instead I am getting a "500 Server Error" page.

However, this Custom Payment Methods is still available in the payment options for my customers.

This is the error I get from the error logs:

Exception

Message:
Fatal Error: Declaration of AdminCustomPaymentsController::uploadImage($id, $name, $dir, $ext = false, $width = null, $height = null) must be compatible with AdminControllerCore::uploadImage($id, $name, $path, $imageExtension = false, $width = null, $height = null, $generateImageTypes = [])


Location:
modules/custompayments/controllers/admin/AdminCustomPayments.php line 429

Here is the line 429 in the AdminCustomPayments.php file.

 protected function uploadImage($id, $name, $dir, $ext = false, $width = null, $height = null)

I did changed my images format from jpg to webp after the upgrade, but I don't think this is the cause.

Any ideas what could cause this?

 

Edited by papagino

8 answers to this question

Recommended Posts

  • 0
Posted

It seems like the module did not modified to comply with recent core commits.

for now you can manually update the module.

edit this file 

modules/custompayments/controllers/admin/AdminCustomPayments.php line 429

and change this

protected function uploadImage($id, $name, $dir, $ext = false, $width = null, $height = null)
{
    $width = (int) Configuration::get(CustomPayments::IMAGE_WIDTH);
    $height = (int) Configuration::get(CustomPayments::IMAGE_HEIGHT);

    return parent::uploadImage($id, $name, $dir, $ext, $width, $height);
}

to this

protected function uploadImage($id, $name, $dir, $ext = false, $width = null, $height = null, $generateImageTypes = [])
{
    $width = (int) Configuration::get(CustomPayments::IMAGE_WIDTH);
    $height = (int) Configuration::get(CustomPayments::IMAGE_HEIGHT);

    return parent::uploadImage($id, $name, $dir, $ext, $width, $height, $generateImageTypes);
}

just to point out that I am not familiar with the custompayment module so I don't know if you will have any other issues.

  • 0
Posted
20 minutes ago, yaniv14 said:

It seems like the module did not modified to comply with recent core commits.

for now you can manually update the module.

edit this file 

modules/custompayments/controllers/admin/AdminCustomPayments.php line 429

and change this

protected function uploadImage($id, $name, $dir, $ext = false, $width = null, $height = null)
{
    $width = (int) Configuration::get(CustomPayments::IMAGE_WIDTH);
    $height = (int) Configuration::get(CustomPayments::IMAGE_HEIGHT);

    return parent::uploadImage($id, $name, $dir, $ext, $width, $height);
}

to this

protected function uploadImage($id, $name, $dir, $ext = false, $width = null, $height = null, $generateImageTypes = [])
{
    $width = (int) Configuration::get(CustomPayments::IMAGE_WIDTH);
    $height = (int) Configuration::get(CustomPayments::IMAGE_HEIGHT);

    return parent::uploadImage($id, $name, $dir, $ext, $width, $height, $generateImageTypes);
}

just to point out that I am not familiar with the custompayment module so I don't know if you will have any other issues.

OK, that fixed the problem...

So, is this a bug in version 1.6?

Does it has anything to do with me changing image format from jpg to webp?

Thanks for your help, you're a PRO.

 

  • 0
Posted
16 minutes ago, the.rampage.rado said:

The module is not updated up until now as this bug was not detected. This module is not very popular.

 

I actually used this module to create 2 new payment methods, one is Pay in 30 Days payment option for some of my resellers (modified Pay by Check module).

The second one is "Interac Email Money Transfer", a payment option available in Canada that allows customers to pay via bank electronic money transfer...

Glad I was able to contribute a bit by identifying something that was missed...

Cheers

  • 0
Posted

For me almost all payment and transport modules stopped working. For transport there is bug in this module, this is not caused by upgrade or TB. And some old module start working again. So there are some changes that can't be easy "to digest"

  • 0
Posted
6 minutes ago, led24ee said:

For me almost all payment and transport modules stopped working. For transport there is bug in this module, this is not caused by upgrade or TB. And some old module start working again. So there are some changes that can't be easy "to digest"

Yea, I guess it's not a good idea to do an upgrade just when it becomes available, probably better to wait a couple weeks...

It is almost impossible for those guys (developer) to absolutely test everything without missing some things.

The best way to contribute is to report the bugs you found so it can be looked at.

 

Cheers

 

  • 0
Posted

I have so many errors that I'm not sure is this caused by TB or not. So I can't report nothing. I have transport module where developer renames database table and then he forgot to put this in every update. ...only 2 hours to find out. And after this he also put some new column and again this was only in next update. So if You don't update every time but for example after 3 or 4 version then You got constant headache and compared with medium grade hangover this hangover is like paradise. In my case this transport module blocks all possibilities to make changes in product ... Then I found another payment module where is error in syntax. I gave all info to developer and answer was "This is impossible to fix." Then I sent video (half minute to google) where is shown fix to this error and it takes about 30 second to fix. After this I haven't get any answer from developer. Here (I mean TB) you got answer, maybe this would be not solution, but in any case this is better than silence. Bad thing is that my coding skills can't be measured, because there simply isn't any. I keep trying, but maybe is better to build all from zero.

  • 0
Posted

If you find any errors, please file github issues. The worst that can happen is that we will close it as a not-a-bug. 

Related to custompayment module - we have just released new version of module that fully supports image rewrite functionality. Mostly, buggy custom code for handling image upload/deletion was deleted, and everything is handled by the core in a generic way. 

  • Thanks 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...