News:

Looking for documentation? Take a look on our wiki

Main Menu

Notice: Undefined index: order_stock_handle

Started by vigier, May 24, 2012, 17:53:38 PM

Previous topic - Next topic

vigier

Hi,

when the order is paid and confirmed, I get a few errors.
The first
Notice: Undefined index: order_stock_handle in C:\wamp\www\Joomla\administrator\components\com_virtuemart\models\orders.php on line 718
Call Stack
#   Time   Memory   Function   Location
1   0.0005   651760   {main}( )   ..\index.php:0
2   0.1073   12215304   JSite->dispatch( )   ..\index.php:42
3   0.1077   12218960   JComponentHelper::renderComponent( )   ..\application.php:198
4   0.1106   12366768   JComponentHelper::executeComponent( )   ..\helper.php:357
5   0.1108   12472520   require_once( 'C:\wamp\www\Joomla\components\com_virtuemart\virtuemart.php' )   ..\helper.php:388
6   0.1315   14798664   JController->execute( )   ..\virtuemart.php:103
7   0.1315   14798744   VirtueMartControllerCart->confirm( )   ..\controller.php:754
8   0.1535   16859488   VirtueMartCart->confirmDone( )   ..\cart.php:397
9   0.3808   21480616   VirtueMartCart->confirmedOrder( )   ..\cart.php:696
10   0.3835   22045048   VirtueMartModelOrders->createOrderFromCart( )   ..\cart.php:982
11   0.4228   23205832   VirtueMartModelOrders->_createOrderLines( )   ..\orders.php:479
12   0.4271   23822168   VirtueMartModelOrders->handleStockAfterStatusChangedPerProduct( )

The second
Notice: Undefined index: order_stock_handle in C:\wamp\www\Joomla\administrator\components\com_virtuemart\models\orders.php on line 731
Call Stack
#   Time   Memory   Function   Location
1   0.0005   651760   {main}( )   ..\index.php:0
2   0.1073   12215304   JSite->dispatch( )   ..\index.php:42
3   0.1077   12218960   JComponentHelper::renderComponent( )   ..\application.php:198
4   0.1106   12366768   JComponentHelper::executeComponent( )   ..\helper.php:357
5   0.1108   12472520   require_once( 'C:\wamp\www\Joomla\components\com_virtuemart\virtuemart.php' )   ..\helper.php:388
6   0.1315   14798664   JController->execute( )   ..\virtuemart.php:103
7   0.1315   14798744   VirtueMartControllerCart->confirm( )   ..\controller.php:754
8   0.1535   16859488   VirtueMartCart->confirmDone( )   ..\cart.php:397
9   0.3808   21480616   VirtueMartCart->confirmedOrder( )   ..\cart.php:696
10   0.3835   22045048   VirtueMartModelOrders->createOrderFromCart( )   ..\cart.php:982
11   0.4228   23205832   VirtueMartModelOrders->_createOrderLines( )   ..\orders.php:479
12   0.4271   23822168   VirtueMartModelOrders->handleStockAfterStatusChangedPerProduct( )

I get these errors for each item I had in the shopping cart. I don't want to have a product_in_stock value since there is unlimited stock.
I happens when product_in_stock is 0 and also when it's at 100000.

Line 718: if ($StatutWhiteList[$newState]['order_stock_handle'] == 'O') $isOut = 1;
Line 731:    if ($StatutWhiteList[$newState]['order_stock_handle'] == 'R') $isReserved = 1;

What am I doing wrong?

P.S. Using VM2.0.6 and Joomla 2.5.4

vigier

When installing the new 2.0.7 version I got the next set of errors:
Error: Install alterTable Unknown column 'order_stock_handle' in 'field list' SQL=UPDATE `tblSR_virtuemart_orderstates` SET `order_stock_handle`="R" WHERE `order_status_code`="P" ;
Error: Install alterTable Unknown column 'order_stock_handle' in 'field list' SQL=UPDATE `tblSR_virtuemart_orderstates` SET `order_stock_handle`="R" WHERE `order_status_code`="C" ;
Error: Install alterTable Unknown column 'order_stock_handle' in 'field list' SQL=UPDATE `tblSR_virtuemart_orderstates` SET `order_stock_handle`="A" WHERE `order_status_code`="X" ;
Error: Install alterTable Unknown column 'order_stock_handle' in 'field list' SQL=UPDATE `tblSR_virtuemart_orderstates` SET `order_stock_handle`="A" WHERE `order_status_code`="R" ;
Error: Install alterTable Unknown column 'order_stock_handle' in 'field list' SQL=UPDATE `tblSR_virtuemart_orderstates` SET `order_stock_handle`="O" WHERE `order_status_code`="S" ;

So I think I miss the column order_stock_handle... How can I fix this?

Milbo

It is very strange, the tableupdater should do it for you. Did you edited the virtuemart.cfg?
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

vigier

#3
No, I didn't. Actually I had to search for it to find it, since I don't like editing things in the administrator map. I usually only edit plugins, CSS files and PHP files.
The strange thing (at least to me) is that the date of virtuemart.cfg is 22 feb 2012 and all the other files in that map are from 25th may 2012 (the day I went from 2.0.6 to 2.0.7).
As far as I can recall 22 feb is the day that I installed the whole VirtueMart for the first time.

P.S. Ohh crap, now I see that going to 2.0.7 might not have been a good idea, since there's already an a/b/c and d version. But I'll wait for going to another version until I know what to do with the missing field in my database.

vigier

Hmm... would it work if I just add a char(1) field order_stock_handle and fill it with the values as are shown in my post above?
Or do I have to do more?