Jump to content

Property Carrier->max_weight is not valid


Recommended Posts

Hi,

 

I've got this error appearing anytime I try to change ANYTHING regarding the carrier options. Anything from trying to delete a carrier option to trying to change an image will result in this error:

 

 

PrestaShopException]

 

Property Carrier->max_weight is not valid

at line 837 in file classes/ObjectModel.php

 

831.

832. $message = $this->validateField($field, $this->$field);

833. if ($message !== true)

834. {

835. if ($die)

836. throw new PrestaShopException($message);

837. return $error_return ? $message : false;

838. }

839. }

840.

841. return true;

 

Anyone have a clue?

 

Thanks a lot in advance!

Share this post


Link to post
Share on other sites

HI, from 0 to 100000 lbs. It says The max_weight field is invalid no matter what I put in there, and when trying to delete it I get the error mentioned above.

 

Here's what the last few rows in one of the carriers look like:

 

Maximium package height:

 

Maximum height managed by this carrier. Set the value to "0," or leave this field blank to ignore.

Maximium package width:

 

Maximum width managed by this carrier. Set the value to "0," or leave this field blank to ignore.

Maximium package depth:

 

Maximum depth managed by this carrier. Set the value to "0," or leave this field blank to ignore.

Maximium package weight:

 

Maximum weight managed by this carrier. Set the value to "0," or leave this field blank to ignore.

 

Thanks..

Share this post


Link to post
Share on other sites

DId you (both) upgrade from previous versions? Anyway, I'd suggest replacing the current carrier class in classes/ with a brand new one, as invalid fields are defined there and something might have gone wrong

Share this post


Link to post
Share on other sites

Hi, since I do have the same problem in new 1.5.4.1 install (no upgrade) I am very interested in the solution to this.

 

My question for the moment is : How / where do I replace the current carrier class with a brand new one mentioned as a solution by the moderator?

 

Jollywood

Edited by jollywood112 (see edit history)

Share this post


Link to post
Share on other sites

Hi, to brightblanks: no I did not solve this yet. I replaced the Carrier.php from a fresh file into the /classes folder but this did not help unfortunately. I too have a fresh install of 1.5.4. Very eager to get this fixed in order to go live. Anyone have any other ideas?

 

Thanks..

Share this post


Link to post
Share on other sites

I did a download of a fresh 1.5.4.1, no problem found with the carrier.

So I found a file: /classes/carrier.php with a difference to the file in my live version 1.5.4.1 :

 

 

I renamed my liveversion of /classes/carrier.php

Uploaded the new carrier.php and for as far as I can see the problem has gone!! :D :D

 

Jollywood

 

P.S. Strange that it is possible to have different PHP files in the same edition (1.5.4.1)

Edited by jollywood112 (see edit history)

Share this post


Link to post
Share on other sites

I had this problem and i found the solution for it as well.

 

In /classes/Carrier.php line 131 I had

 

'max_weight' =>  array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt'),

 

instead of

 

'max_weight' =>    array('type' => self::TYPE_INT, 'validate' => 'isFloat'),

 

Change that and you're good to go

  • Like 1

Share this post


Link to post
Share on other sites

  • 4 months later...

I had this problem and i found the solution for it as well.

 

In /classes/Carrier.php line 131 I had

 

'max_weight' =>  array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt'),
instead of

 

'max_weight' =>    array('type' => self::TYPE_INT, 'validate' => 'isFloat'),
Change that and you're good to go

 

Very Goood!!!

Share this post


Link to post
Share on other sites

 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More