Jump to content

[Solved] V1.4 error... Fatal error (StockMvt -> id_stock_mvt_reason = -1)


Recommended Posts

Fail to change location on product. If a product are located in Home and a subcategory and I try to remove them from either I get this error message and nothing are changed: Fatal error (StockMvt -> id_stock_mvt_reason = -1)

I also tried to add a location for the product to another subcategory just for testing with same result.

It seems there is some error with a sql location probably. Anyone else have this problem?

I have the 1.4.0.17 version of prestashop..

Link to comment
Share on other sites

Ok guys
not got a full answer to permanently fix but in mean time
When editing or adding product on first page find stock change and drop down box, change to increase, dont change number just leave increase showing.
Then click save or if adding image click images
it will then let you do it without error

Works for me but not permanent as a pain
Anyone got an idea how to alter value in database so that increase is default selection?

Link to comment
Share on other sites

I was able to get it to work by changing the default stock movement option, to another and then back to "order"


What menu/tab/option and where is it located?


BO -> catalog-> stock movement -> scroll down to the bottom
Link to comment
Share on other sites

I was able to get it to work by changing the default stock movement option, to another and then back to "order"


What menu/tab/option and where is it located?


BO -> catalog-> stock movement -> scroll down to the bottom


uhm.. I don`t have a tab to choose under catalog that is called stock movement.

40861_mowF1NNgw7GtkfWGXXEd_t

Link to comment
Share on other sites

Hmm weird I do, i have version 1.4.0.17


Same like me then.. hmm..

I only had this error when i upgraded. Maybe that is some tabs :-(

I wonder if I could get the Admin catalog from a working shop and copy it over my shop

40864_ubwJESZLyDctE5HQuAaK_t

Link to comment
Share on other sites

Hi everyone

If you klick on Catalog and on Stcok Movements on the right you will come to this page.

Go to the bottom and you see the Default Stock Movement reason:

Choose wich one you want to have as default and klick Save.

That took away the error message for me.

41068_6yyyZ7UiP2LZOkFWOnqK_t

Link to comment
Share on other sites

Changing the stock movement to increase instead of order also worked for adding images and editing other areas witch had some trouble doing. I also would like to point out I was using IE9 and that wass part of my problem because trying to use some of the functions didn't work in the browser. However I switched to firefox AND CHANGED stock movement to increase instead of order and everything works great now.

Thanks for the tip!

Link to comment
Share on other sites

  • 7 months later...
  • 3 months later...

Hi Guys,

 

i also faced the same issue in updating the prestashop 1.3 to 1.4.

Did lot of RND but didn't got the solutons.

 

At last after spending lot of time i found one permanent solutions to the problem.

 

First of all, the problem rises because there is no option called "Stock Movements" in Prestashop 1.3 and this is the new feature added to the Prestashop 1.4. So the when we add new product it checks for the value of "id_mvt_reason" in the Product class which returns -1 which in-return creates problem in adding new product.

 

Solution: We don't have to make any modification anywhere in the Database; what we need to do is just go to "Tools.php" file inside classes folder and look for the getValue$key, $defaultValue = false) function in that. It would be on line no. 208 i guess not sure it depends upon the changes in the file.

 

Just replace the following code in that function:

 

return !is_string($ret)? $ret : stripslashes($ret);

 

with

 

 

if($key != 'id_mvt_reason')

return !is_string($ret)? $ret : stripslashes($ret);

else

return 1;

 

And just upload the file and check.

 

Your problem goes away forever.

 

Please Note: I'm not aware of the "Stock Movement" functionality; and those who knows please check that doesn't break their code.

 

Cheers Guys!!!

 

Varinder Singh

Link to comment
Share on other sites

Hi Guys,

 

i also faced the same issue in updating the prestashop 1.3 to 1.4.

Did lot of RND but didn't got the solutons.

 

At last after spending lot of time i found one permanent solutions to the problem.

 

First of all, the problem rises because there is no option called "Stock Movements" in Prestashop 1.3 and this is the new feature added to the Prestashop 1.4. So the when we add new product it checks for the value of "id_mvt_reason" in the Product class which returns -1 which in-return creates problem in adding new product.

 

Solution: We don't have to make any modification anywhere in the Database; what we need to do is just go to "Tools.php" file inside classes folder and look for the getValue$key, $defaultValue = false) function in that. It would be on line no. 208 i guess not sure it depends upon the changes in the file.

 

Just replace the following code in that function:

 

return !is_string($ret)? $ret : stripslashes($ret);

 

with

 

 

if($key != 'id_mvt_reason')

return !is_string($ret)? $ret : stripslashes($ret);

else

return 1;

 

And just upload the file and check.

 

Your problem goes away forever.

 

Please Note: I'm not aware of the "Stock Movement" functionality; and those who knows please check that doesn't break their code.

 

Cheers Guys!!!

 

Varinder Singh

Link to comment
Share on other sites

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...