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

Missing field “position”
 
RPGShop
Sr. Member
 
Total Posts:  143
Joined:  2008-06-16
 

Doing a search for anything on my site I get this below error… running the SQL it states that there are no fields called “position”.  Is this maybe an addon problem?  Or did the update fail to put in a “position” field? What table should it be in? I could use that to just set it equal to the entity_id and then have it auto-increment and it would fix the display category sections by most recently added product issue I’ve had.

Thoughts?
James

Magento Commerce
There has been an error processing your request.

SELECT 1 AS `status`, `e`.`entity_id`, `e`.`type_id`, `e`.`attribute_set_id`, `e`.`name`, `e`.`description`, `e`.`short_description`, `e`.`price`, `e`.`special_price`, `e`.`special_from_date`, `e`.`special_to_date`, `e`.`image`, `e`.`small_image`, `e`.`thumbnail`, `e`.`tax_class_id`, `e`.`url_key`, `e`.`price_type`, `e`.`weight_type`, `e`.`price_view`, `e`.`shipment_type`, `e`.`required_options`, `e`.`image_label`, `e`.`small_image_label`, `e`.`thumbnail_label`, `e`.`ugiftcert_amount_config`, `search_result`.`relevance`, `e`.`price`, `e`.`special_price`, `e`.`special_from_date`, `e`.`special_to_date`, `e`.`display_price_group_0` AS `_rule_price` FROM `catalog_product_flat_1` AS `e`
INNER JOIN `catalogsearch_result` AS `search_result` ON search_result.product_id=e.entity_id AND search_result.query_id=’5920’
INNER JOIN `catalog_product_enabled_index` AS `enabled_index` ON enabled_index.product_id=e.entity_id AND enabled_index.store_id=’1’ AND enabled_index.visibility IN (3, 4) ORDER BY `position` desc LIMIT 30

Trace:
#0 /var/www/vhosts/rpgshop.com/httpdocs/lib/Zend/Db/Statement.php(283): Zend_Db_Statement_Pdo->_execute(Array)
#1 /var/www/vhosts/rpgshop.com/httpdocs/lib/Zend/Db/Adapter/Abstract.php(457): Zend_Db_Statement->execute(Array)
#2 /var/www/vhosts/rpgshop.com/httpdocs/lib/Zend/Db/Adapter/Pdo/Abstract.php(230): Zend_Db_Adapter_Abstract->query(’SELECT 1 AS `st...’, Array)
#3 /var/www/vhosts/rpgshop.com/httpdocs/lib/Varien/Db/Adapter/Pdo/Mysql.php(259): Zend_Db_Adapter_Pdo_Abstract->query(’SELECT 1 AS `st...’, Array)
#4 /var/www/vhosts/rpgshop.com/httpdocs/lib/Zend/Db/Adapter/Abstract.php(668): Varien_Db_Adapter_Pdo_Mysql->query(Object(Varien_Db_Select), Array)
#5 /var/www/vhosts/rpgshop.com/httpdocs/lib/Varien/Data/Collection/Db.php(761): Zend_Db_Adapter_Abstract->fetchAll(Object(Varien_Db_Select), Array)
#6 /var/www/vhosts/rpgshop.com/httpdocs/app/code/core/Mage/Eav/Model/Entity/Collection/Abstract.php(933): Varien_Data_Collection_Db->_fetchAll(Object(Varien_Db_Select))
#7 /var/www/vhosts/rpgshop.com/httpdocs/app/code/core/Mage/Eav/Model/Entity/Collection/Abstract.php(783): Mage_Eav_Model_Entity_Collection_Abstract->_loadEntities(false, false)
#8 /var/www/vhosts/rpgshop.com/httpdocs/app/code/core/Mage/Catalog/Block/Product/List.php(151): Mage_Eav_Model_Entity_Collection_Abstract->load()
#9 /var/www/vhosts/rpgshop.com/httpdocs/app/code/core/Mage/Core/Block/Abstract.php(642): Mage_Catalog_Block_Product_List->_beforeToHtml()
#10 /var/www/vhosts/rpgshop.com/httpdocs/app/code/core/Mage/Core/Block/Abstract.php(503): Mage_Core_Block_Abstract->toHtml()
#11 /var/www/vhosts/rpgshop.com/httpdocs/app/code/core/Mage/Core/Block/Abstract.php(454): Mage_Core_Block_Abstract->_getChildHtml(’search_result_l...’, true)
#12 /var/www/vhosts/rpgshop.com/httpdocs/app/code/core/Mage/CatalogSearch/Block/Result.php(144): Mage_Core_Block_Abstract->getChildHtml(’search_result_l...’)
#13 /var/www/vhosts/rpgshop.com/httpdocs/app/design/frontend/RPGWebsite/default/template/catalogsearch/result.phtml(26): Mage_CatalogSearch_Block_Result->getProductListHtml()
#14 /var/www/vhosts/rpgshop.com/httpdocs/app/code/core/Mage/Core/Block/Template.php(144): include(’/var/www/vhosts...’)
#15 /var/www/vhosts/rpgshop.com/httpdocs/app/code/core/Mage/Core/Block/Template.php(176): Mage_Core_Block_Template->fetchView(’frontend/RPGWeb...’)
#16 /var/www/vhosts/rpgshop.com/httpdocs/app/code/core/Mage/Core/Block/Template.php(193): Mage_Core_Block_Template->renderView()
#17 /var/www/vhosts/rpgshop.com/httpdocs/app/code/core/Mage/Core/Block/Abstract.php(643): Mage_Core_Block_Template->_toHtml()
#18 /var/www/vhosts/rpgshop.com/httpdocs/app/code/core/Mage/Core/Block/Text/List.php(43): Mage_Core_Block_Abstract->toHtml()
#19 /var/www/vhosts/rpgshop.com/httpdocs/app/code/core/Mage/Core/Block/Abstract.php(643): Mage_Core_Block_Text_List->_toHtml()
#20 /var/www/vhosts/rpgshop.com/httpdocs/app/code/core/Mage/Core/Block/Abstract.php(503): Mage_Core_Block_Abstract->toHtml()
#21 /var/www/vhosts/rpgshop.com/httpdocs/app/code/core/Mage/Core/Block/Abstract.php(454): Mage_Core_Block_Abstract->_getChildHtml(’content’, true)
#22 /var/www/vhosts/rpgshop.com/httpdocs/app/design/frontend/RPGWebsite/default/template/page/3columns.phtml(68): Mage_Core_Block_Abstract->getChildHtml(’content’)
#23 /var/www/vhosts/rpgshop.com/httpdocs/app/code/core/Mage/Core/Block/Template.php(144): include(’/var/www/vhosts...’)
#24 /var/www/vhosts/rpgshop.com/httpdocs/app/code/core/Mage/Core/Block/Template.php(176): Mage_Core_Block_Template->fetchView(’frontend/RPGWeb...’)
#25 /var/www/vhosts/rpgshop.com/httpdocs/app/code/core/Mage/Core/Block/Template.php(193): Mage_Core_Block_Template->renderView()
#26 /var/www/vhosts/rpgshop.com/httpdocs/app/code/core/Mage/Core/Block/Abstract.php(643): Mage_Core_Block_Template->_toHtml()
#27 /var/www/vhosts/rpgshop.com/httpdocs/app/code/core/Mage/Core/Model/Layout.php(526): Mage_Core_Block_Abstract->toHtml()
#28 /var/www/vhosts/rpgshop.com/httpdocs/app/code/core/Mage/Core/Controller/Varien/Action.php(339): Mage_Core_Model_Layout->getOutput()
#29 /var/www/vhosts/rpgshop.com/httpdocs/app/code/core/Mage/CatalogSearch/controllers/ResultController.php(79): Mage_Core_Controller_Varien_Action->renderLayout()
#30 /var/www/vhosts/rpgshop.com/httpdocs/app/code/core/Mage/Core/Controller/Varien/Action.php(367): Mage_CatalogSearch_ResultController->indexAction()
#31 /var/www/vhosts/rpgshop.com/httpdocs/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(247): Mage_Core_Controller_Varien_Action->dispatch(’index’)
#32 /var/www/vhosts/rpgshop.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))
#33 /var/www/vhosts/rpgshop.com/httpdocs/app/Mage.php(457): Mage_Core_Controller_Varien_Front->dispatch()
#34 /var/www/vhosts/rpgshop.com/httpdocs/index.php(52): Mage::run()
#35 {main}

Magento is a trademark of Irubin Consulting Inc. DBA Varien. Copyright © 2008 Irubin Consulting Inc.

 
Magento Community Magento Community
Magento Community
Magento Community
 
RPGShop
Sr. Member
 
Total Posts:  143
Joined:  2008-06-16
 

I uninstalled the advance search addon, but it’s still giving me this same error on searching.

James
http://www.rpgshop.com

 
Magento Community Magento Community
Magento Community
Magento Community
 
RPGShop
Sr. Member
 
Total Posts:  143
Joined:  2008-06-16
 

Ok, I added “position” as an int 11 to the catalog_product_flat_1 (and any other _x) table and the error went away. So that’s the table it was missing from. But where does it come from and why did the rebuild flat category product not fail if it was missing? I then ran an sql to set all the positions to the entity id ( update catalog_product_flat_1 set position = entity_id; ) in hopes that then it would sort properly with desc position as the browser says it is… it didn’t. What gives there?  Shouldn’t a sort by position listed in the grid sort by the position field in the flat table?

Blah, what a bloodly mess.

James
http://www.JamesMathe.com

 
Magento Community Magento Community
Magento Community
Magento Community
 
Bladimir Arroyo
Jr. Member
 
Total Posts:  7
Joined:  2009-04-29
 

Does anybody still got this issue?, I followed James suggestions but didn’t work, any ideas?

 
Magento Community Magento Community
Magento Community
Magento Community
 
RPGShop
Sr. Member
 
Total Posts:  143
Joined:  2008-06-16
 

Actually using the trick I did caused duplicate field errors when you did a search… so the only answer I had for this in the end was to just stop using flat catalog. Turn if off.  Wasn’t much of a speed difference with my server anyway.

James

 
Magento Community Magento Community
Magento Community
Magento Community
 
Bladimir Arroyo
Jr. Member
 
Total Posts:  7
Joined:  2009-04-29
 

Thanks James, I tried by not using the position as default the filter and it does works but in that case I would need to remove the position from the filter choice box, any idea?

 
Magento Community Magento Community
Magento Community
Magento Community
 
RPGShop
Sr. Member
 
Total Posts:  143
Joined:  2008-06-16
 

Not sure I understand you but there is a config.xml file that contains the options… I’ve had a hard time getting all that crap to work though.

<shrug>

James

 
Magento Community Magento Community
Magento Community
Magento Community
 
Bladimir Arroyo
Jr. Member
 
Total Posts:  7
Joined:  2009-04-29
 

Thanks James, I think I know what u mean, even when I disabled the Position sort filter, the Price sort doesn’t seem to work neither smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
advocat
Sr. Member
 
Avatar
Total Posts:  99
Joined:  2008-01-03
UA Kyiv
 

Fixed Flat Catalog Product Index logic
Added additional sort by id when sorted by position

File Attachments
magento_131_flat_cat_index.zip  (File Size: 3KB - Downloads: 134)
 
Magento Community Magento Community
Magento Community
Magento Community
 
Polo Magento
Jr. Member
 
Total Posts:  21
Joined:  2008-12-11
 

Same Issue here.

- Does anyone has a fix with working position ?
- Is there any ticket in the magento SVN ?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Mirasvit
Guru
 
Avatar
Total Posts:  639
Joined:  2009-08-22
 

Hi.
Check out these extension. They greatly improve the quality and relevance of search results Advanced Search for Shared Hosting http://mirasvit.com/magento-extensions/magento-advanced-search-for-shared-hosting.html

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top