Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Page 1 of 2
Low Stock Reports Broken after 1.3.2.1 to 1.3.2.2 upgrade
 
eazypeazy
Jr. Member
 
Total Posts:  14
Joined:  2009-04-09
 

Hi

After upgrading my site from 1.3.2.1 to 1.3.2.2 I can no longer create Low Stock reports from Reports->Products->Low Stock

I get the this error:

Error:
Invalid attribute nameqty

Trace
:
#0 /var/www/vhosts/www.mydreammobile.com/httpdocs/app/code/core/Mage/Eav/Model/Entity/Collection/Abstract.php(1130): Mage::exception('Mage_Eav', 'Invalid attribu...')
#1 /var/www/vhosts/www.mydreammobile.com/httpdocs/app/code/core/Mage/Eav/Model/Entity/Collection/Abstract.php(1214): Mage_Eav_Model_Entity_Collection_Abstract->_addAttributeJoin('qty', 'inner')
#2 /var/www/vhosts/www.mydreammobile.com/httpdocs/app/code/core/Mage/Eav/Model/Entity/Collection/Abstract.php(294): Mage_Eav_Model_Entity_Collection_Abstract->_getAttributeConditionSql('qty', Array, 'inner')
#3 /var/www/vhosts/www.mydreammobile.com/httpdocs/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Collection.php(1005): Mage_Eav_Model_Entity_Collection_Abstract->addAttributeToFilter('qty', Array, 'inner')
#4 /var/www/vhosts/www.mydreammobile.com/httpdocs/app/code/core/Mage/Eav/Model/Entity/Collection/Abstract.php(314): Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection->addAttributeToFilter('qty', Array)
#5 /var/www/vhosts/www.mydreammobile.com/httpdocs/app/code/core/Mage/Adminhtml/Block/Widget/Grid.php(331): Mage_Eav_Model_Entity_Collection_Abstract->addFieldToFilter('qty', Array)
#6 /var/www/vhosts/www.mydreammobile.com/httpdocs/app/code/core/Mage/Adminhtml/Block/Widget/Grid.php(316): Mage_Adminhtml_Block_Widget_Grid->_addColumnFilterToCollection(Object(Mage_Adminhtml_Block_Widget_Grid_Column))
#7 /var/www/vhosts/www.mydreammobile.com/httpdocs/app/code/core/Mage/Adminhtml/Block/Widget/Grid.php(361): Mage_Adminhtml_Block_Widget_Grid->_setFilterValues(Array)
#8 /var/www/vhosts/www.mydreammobile.com/httpdocs/app/code/core/Mage/Adminhtml/Block/Report/Product/Lowstock/Grid.php(73): Mage_Adminhtml_Block_Widget_Grid->_prepareCollection()
#9 /var/www/vhosts/www.mydreammobile.com/httpdocs/app/code/core/Mage/Adminhtml/Block/Widget/Grid.php(458): Mage_Adminhtml_Block_Report_Product_Lowstock_Grid->_prepareCollection()
#10 /var/www/vhosts/www.mydreammobile.com/httpdocs/app/code/core/Mage/Adminhtml/Block/Widget/Grid.php(464): Mage_Adminhtml_Block_Widget_Grid->_prepareGrid()
#11 /var/www/vhosts/www.mydreammobile.com/httpdocs/app/code/core/Mage/Core/Block/Abstract.php(642): Mage_Adminhtml_Block_Widget_Grid->_beforeToHtml()
#12 /var/www/vhosts/www.mydreammobile.com/httpdocs/app/code/core/Mage/Core/Block/Abstract.php(503): Mage_Core_Block_Abstract->toHtml()
#13 /var/www/vhosts/www.mydreammobile.com/httpdocs/app/code/core/Mage/Core/Block/Abstract.php(454): Mage_Core_Block_Abstract->_getChildHtml('grid', true)
#14 /var/www/vhosts/www.mydreammobile.com/httpdocs/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Container.php(70): Mage_Core_Block_Abstract->getChildHtml('grid')
#15 /var/www/vhosts/www.mydreammobile.com/httpdocs/app/code/core/Mage/Adminhtml/Block/Report/Product/Lowstock.php(67): Mage_Adminhtml_Block_Widget_Grid_Container->getGridHtml()
#16 /var/www/vhosts/www.mydreammobile.com/httpdocs/app/design/adminhtml/default/default/template/widget/grid/container.phtml(36): Mage_Adminhtml_Block_Report_Product_Lowstock->getGridHtml()
#17 /var/www/vhosts/www.mydreammobile.com/httpdocs/app/code/core/Mage/Core/Block/Template.php(144): include('/var/www/vhosts...')
#18 /var/www/vhosts/www.mydreammobile.com/httpdocs/app/code/core/Mage/Core/Block/Template.php(176): Mage_Core_Block_Template->fetchView('adminhtml/defau...')
#19 /var/www/vhosts/www.mydreammobile.com/httpdocs/app/code/core/Mage/Core/Block/Template.php(193): Mage_Core_Block_Template->renderView()
#20 /var/www/vhosts/www.mydreammobile.com/httpdocs/app/code/core/Mage/Adminhtml/Block/Template.php(81): Mage_Core_Block_Template->_toHtml()
#21 /var/www/vhosts/www.mydreammobile.com/httpdocs/app/code/core/Mage/Adminhtml/Block/Widget/Container.php(225): Mage_Adminhtml_Block_Template->_toHtml()
#22 /var/www/vhosts/www.mydreammobile.com/httpdocs/app/code/core/Mage/Core/Block/Abstract.php(643): Mage_Adminhtml_Block_Widget_Container->_toHtml()
#23 /var/www/vhosts/www.mydreammobile.com/httpdocs/app/code/core/Mage/Core/Block/Text/List.php(43): Mage_Core_Block_Abstract->toHtml()
#24 /var/www/vhosts/www.mydreammobile.com/httpdocs/app/code/core/Mage/Core/Block/Abstract.php(643): Mage_Core_Block_Text_List->_toHtml()
#25 /var/www/vhosts/www.mydreammobile.com/httpdocs/app/code/core/Mage/Core/Block/Abstract.php(503): Mage_Core_Block_Abstract->toHtml()
#26 /var/www/vhosts/www.mydreammobile.com/httpdocs/app/code/core/Mage/Core/Block/Abstract.php(454): Mage_Core_Block_Abstract->_getChildHtml('content', true)
#27 /var/www/vhosts/www.mydreammobile.com/httpdocs/app/design/adminhtml/default/wysiwyg/template/page.phtml(74): Mage_Core_Block_Abstract->getChildHtml('content')
#28 /var/www/vhosts/www.mydreammobile.com/httpdocs/app/code/core/Mage/Core/Block/Template.php(144): include('/var/www/vhosts...')
#29 /var/www/vhosts/www.mydreammobile.com/httpdocs/app/code/core/Mage/Core/Block/Template.php(176): Mage_Core_Block_Template->fetchView('adminhtml/defau...')
#30 /var/www/vhosts/www.mydreammobile.com/httpdocs/app/code/core/Mage/Core/Block/Template.php(193): Mage_Core_Block_Template->renderView()
#31 /var/www/vhosts/www.mydreammobile.com/httpdocs/app/code/core/Mage/Adminhtml/Block/Template.php(81): Mage_Core_Block_Template->_toHtml()
#32 /var/www/vhosts/www.mydreammobile.com/httpdocs/app/code/core/Mage/Core/Block/Abstract.php(643): Mage_Adminhtml_Block_Template->_toHtml()
#33 /var/www/vhosts/www.mydreammobile.com/httpdocs/app/code/core/Mage/Core/Model/Layout.php(526): Mage_Core_Block_Abstract->toHtml()
#34 /var/www/vhosts/www.mydreammobile.com/httpdocs/app/code/core/Mage/Core/Controller/Varien/Action.php(347): Mage_Core_Model_Layout->getOutput()
#35 /var/www/vhosts/www.mydreammobile.com/httpdocs/app/code/core/Mage/Adminhtml/controllers/Report/ProductController.php(182): Mage_Core_Controller_Varien_Action->renderLayout()
#36 /var/www/vhosts/www.mydreammobile.com/httpdocs/app/code/core/Mage/Core/Controller/Varien/Action.php(376): Mage_Adminhtml_Report_ProductController->lowstockAction()
#37 /var/www/vhosts/www.mydreammobile.com/httpdocs/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(248): Mage_Core_Controller_Varien_Action->dispatch('lowstock')
#38 /var/www/vhosts/www.mydreammobile.com/httpdocs/app/code/core/Mage/Core/Controller/Varien/Front.php(158): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#39 /var/www/vhosts/www.mydreammobile.com/httpdocs/app/Mage.php(459): Mage_Core_Controller_Varien_Front->dispatch()
#40 /var/www/vhosts/www.mydreammobile.com/httpdocs/index.php(65): Mage::run()
#41 {main}

Anybody got this same error?

 
Magento Community Magento Community
Magento Community
Magento Community
 
ma77z
Jr. Member
 
Total Posts:  2
Joined:  2009-07-07
 

Same problem here, encountered after upgrading from 1.2.1 to 1.3.2.2. I have filed a bug report here: http://www.magentocommerce.com/bug-tracking/issue?issue=6905

After looking in magento/app/code/core/Mage/Reports/Model/Mysql4/Product/Lowstock/Collection.php, I can see 2 references to qty:

/**
* @return Mage_Reports_Model_Mysql4_Product_Collection
*/
    public function filterByIsQtyProductTypes() 
    
{
        $this
->filterByProductType(
            
array_keys(array_filter(Mage::helper('cataloginventory')->getIsQtyTypeIds()))
        );
        return 
$this;
    
}

and

/**
* @param int|null $storeId
 * @return Mage_Reports_Model_Mysql4_Product_Collection
*/
    public function useNotifyStockQtyFilter($storeId=null)
    
{
        $this
->joinInventoryItem(array('qty'));
        
$this->getSelect()->where(sprintf('qty < IF(%s,%d,%s)'
            
$this->_processInventoryItemFields('use_config_notify_stock_qty'), 
            (int) 
Mage::getStoreConfig(Mage_CatalogInventory_Model_Stock_Item::XML_PATH_NOTIFY_STOCK_QTY,$storeId), 
            
$this->_processInventoryItemFields('notify_stock_qty')));
        return 
$this;
    
}

Not too sure if the error is occurring here, or is in another file.

 
Magento Community Magento Community
Magento Community
Magento Community
 
justintime67
Sr. Member
 
Avatar
Total Posts:  188
Joined:  2009-08-12
 

I am having the same issue on 1.3.2.4… anyone know how to fix it?? Could really use this report!  Cheers

 
Magento Community Magento Community
Magento Community
Magento Community
 
adonkey
Member
 
Total Posts:  67
Joined:  2008-10-28
 

Bumped, I have the same problem

 
Magento Community Magento Community
Magento Community
Magento Community
 
justintime67
Sr. Member
 
Avatar
Total Posts:  188
Joined:  2009-08-12
 

Still no ideas?  Now the error is 503 Service Unavailable “Server is temporarily busy”

 
Magento Community Magento Community
Magento Community
Magento Community
 
Lane Yaremchuk
Jr. Member
 
Total Posts:  22
Joined:  2009-05-06
Edmonton Alberta, Canada
 

Same error here. Using v1.3.2.4. Is there a solution to this somewhere?  Mine errors only when I try to filter the qty.

 
Magento Community Magento Community
Magento Community
Magento Community
 
justintime67
Sr. Member
 
Avatar
Total Posts:  188
Joined:  2009-08-12
 

Are we ever going to get a response from Magento???

 
Magento Community Magento Community
Magento Community
Magento Community
 
Lane Yaremchuk
Jr. Member
 
Total Posts:  22
Joined:  2009-05-06
Edmonton Alberta, Canada
 

Apparently not. I just don’t use this functionality. I guess maybe the latest version works, I don’t know.

 
Magento Community Magento Community
Magento Community
Magento Community
 
benz001
Sr. Member
 
Avatar
Total Posts:  238
Joined:  2009-02-05
Sydney
 

According to the bug report this has been fixed in 1.4, browsing through the 1.4 svn the classes to alter to backport it appear to be:
class Mage_Reports_Model_Mysql4_Product_Lowstock_Collection

I’ve not down much testing so far, but after comparing the old and new classes it looks like a drop in replacement and that does appear to work.

 
Magento Community Magento Community
Magento Community
Magento Community
 
justintime67
Sr. Member
 
Avatar
Total Posts:  188
Joined:  2009-08-12
 

great news benz001! If only i had the guts to upgrade rasberry

 
Magento Community Magento Community
Magento Community
Magento Community
 
justintime67
Sr. Member
 
Avatar
Total Posts:  188
Joined:  2009-08-12
 

Does anyone have a solution to this broken low stock report??? It is killing me!!

Full error message is here: http://www.happycow.com.au/error-message.txt

 
Magento Community Magento Community
Magento Community
Magento Community
 
elfling
Enthusiast
 
Avatar
Total Posts:  901
Joined:  2008-10-21
 

I tried this. But still gives the qty filter error.

Edit - Don’t Just replace the QTY classes.

At the end of joinInventoryItem

you’ll need to make sure you add in this

if (!is_array($fields)) {
            
if (empty($fields)) {
                $fields 
= array();
            
else {
                $fields 
= array($fields);
            
}
        }

        
foreach ($fields as $alias => $field{
            
if (!is_string($alias)) {
                $alias 
null;
            
}
            $this
->_addInventoryItemFieldToSelect($field$alias);
        
}

        
return $this;
    
}

So you’d be better off replacing the whole collection.php file.

Copy of low stock collection that I used.

This worked in 1.3.1 for me. So it will definitely work in higher versions of Mage

 
Magento Community Magento Community
Magento Community
Magento Community
 
xer0x
Jr. Member
 
Total Posts:  9
Joined:  2009-05-19
 

Has anyone had any luck fixing this yet?

 
Magento Community Magento Community
Magento Community
Magento Community
 
justintime67
Sr. Member
 
Avatar
Total Posts:  188
Joined:  2009-08-12
 

i gave up and then found that you can get all your SKUs in analytics, under Ecommerce > Product Performance

 
Magento Community Magento Community
Magento Community
Magento Community
 
elfling
Enthusiast
 
Avatar
Total Posts:  901
Joined:  2008-10-21
 

Open up the copy of the collection.php file that I posted and paste it over the top of yours and upload it. Works fine.

 
Magento Community Magento Community
Magento Community
Magento Community
 
justintime67
Sr. Member
 
Avatar
Total Posts:  188
Joined:  2009-08-12
 

i tried it but now i get error message:

Fatal error: Class ‘Mage_Adminhtml_Block_Report_Product_Lowstock_Grid’ not found in /app/code/core/Mage/Core/Model/Layout.php on line 462

any ideas??

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top
Page 1 of 2