News:

Looking for documentation? Take a look on our wiki

Main Menu

[fixed] New ordering issue in svn version

Started by jjk, October 03, 2011, 20:47:20 PM

Previous topic - Next topic

jjk

J1.7.1/VM2 SVN revision 4232
Is the new ordering code still work in progess? After updating to latest svn version I've got an empty BE Product List if sorting by 'Manufacturers' or 'Product Category' is selected.
VM Debug says:

vmdebug exeSortSearchListQuery error in db Var1:

Unknown column 'm.mf_name' in 'order clause' SQL=SELECT SQL_CALC_FOUND_ROWS  * FROM `jos_virtuemart_products` AS p LEFT JOIN `jos_virtuemart_product_manufacturers` ON p.`virtuemart_product_id` = `jos_virtuemart_product_manufacturers`.`virtuemart_product_id`
          LEFT JOIN `jos_virtuemart_manufacturers` ON `jos_virtuemart_manufacturers`.`virtuemart_manufacturer_id` = `jos_virtuemart_product_manufacturers`.`virtuemart_manufacturer_id`  ORDER BY `m.mf_name` ASC LIMIT 600, 25

Update:
...and when using the 'Search' field in BE Product List, also:

vmdebug checkValidOrderingField: programmer choosed invalid ordering c.category_name, use p.virtuemart_product_id
vmdebug exeSortSearchListQuery error in db Var1:

Unknown column 'c.category_name' in 'order clause' SQL=SELECT SQL_CALC_FOUND_ROWS  * FROM `jos_virtuemart_products` AS p LEFT JOIN `jos_virtuemart_product_categories` ON p.`virtuemart_product_id` = `jos_virtuemart_product_categories`.`virtuemart_product_id`
                  LEFT JOIN `jos_virtuemart_categories` ON `jos_virtuemart_categories`.`virtuemart_category_id` = `jos_virtuemart_product_categories`.`virtuemart_category_id` WHERE (p.`product_name` LIKE "%Schneller%" AND  `jos_virtuemart_product_categories`.`virtuemart_category_id` = 11)  ORDER BY `c.category_name` ASC LIMIT 0, 25

vmdebug checkValidOrderingField: programmer choosed invalid ordering c.category_name, use p.virtuemart_product_id

Update 2:
And in the frontend links to a category now display only:
vmdebug exeSortSearchListQuery error in db Var1:

Column 'virtuemart_product_id' in order clause is ambiguous SQL=SELECT * FROM `jos_virtuemart_products` AS p LEFT JOIN `jos_virtuemart_product_categories` ON p.`virtuemart_product_id` = `jos_virtuemart_product_categories`.`virtuemart_product_id` LEFT JOIN `jos_virtuemart_categories` ON `jos_virtuemart_categories`.`virtuemart_category_id` = `jos_virtuemart_product_categories`.`virtuemart_category_id` WHERE ( p.`published`="1" AND `jos_virtuemart_product_categories`.`virtuemart_category_id` = 7) ORDER BY virtuemart_product_id ASC
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

grtrustme

I m using rev 4244.

My BE product list sorting works as expected, search results are correct as well as category links.

Please update to 4244 and confirm if this is happening again.

Have a great day.

jjk

#2
J1.7.1/VM2 SVN revision 4245
In the BE Product List VM Debug now shows two copies of this line:
vmdebug checkValidOrderingField: programmer choosed invalid ordering m.mf_name, use p.virtuemart_product_id

The list of products is back, but clicking on the 'Product Category' and 'Manufacturer' column titles actually don't sort the columns (ascending/descending).

------------------

Also, in the frontend, clicking on a category link in the menu frequently loads the default categories browse page (browse page with products from all categories) including unpublished categories, although they are all set to a customised category browse page. (I had this effect with revision 4232 already). Clicking one of the category thumnails or category titles above, the correct category browse gets loaded.
...I wonder if this might somehow be related to the fact that I have unpublished products/child products (from VM1.x) in the list, which don't have a manufacturer assigned to it.

-----------------

Once, when I tried to go from page 2 in the pagination to page 1, I ended up in the 'Media File List' and VM Debug showed this:

vmdebug exeSortSearchListQuery error in db Var1:

Column 'ordering' in order clause is ambiguous SQL=SELECT SQL_CALC_FOUND_ROWS  `jos_virtuemart_medias`.`virtuemart_media_id` as virtuemart_media_id  FROM `jos_virtuemart_product_medias` LEFT JOIN `jos_virtuemart_medias` ON `jos_virtuemart_medias`.`virtuemart_media_id`=`jos_virtuemart_product_medias`.`virtuemart_media_id` and `virtuemart_product_id` = "51" WHERE `virtuemart_product_id` = "51" ORDER BY ordering ASC LIMIT 0, 25

#0 vmTrace(productsortseachr, 1) called at [...\administrator\components\com_virtuemart\helpers\vmmodel.php:336] #1 VmModel->exeSortSearchListQuery(2, `#__virtuemart_medias`.`virtuemart_media_id` as virtuemart_media_id FROM `#__virtuemart_product_medias`, LEFT JOIN `#__virtuemart_medias` ON `#__virtuemart_medias`.`virtuemart_media_id`=`#__virtuemart_product_medias`.`virtuemart_media_id` and `virtuemart_product_id` = "51", WHERE `virtuemart_product_id` = "51", , ORDER BY ordering ASC) called at [...\administrator\components\com_virtuemart\models\media.php:219] #2 VirtueMartModelMedia->getFiles() called at [...\administrator\components\com_virtuemart\views\media\view.html.php:73] #3 VirtuemartViewMedia->display() called at [...\libraries\joomla\application\component\controller.php:650] #4 JController->display() called at [...\administrator\components\com_virtuemart\controllers\media.php:54] #5 VirtuemartControllerMedia->Media() called at [...\libraries\joomla\application\component\controller.php:684] #6 JController->execute(media) called at [...\administrator\components\com_virtuemart\admin.virtuemart.php:59] #7 require_once(...\administrator\components\com_virtuemart\admin.virtuemart.php) called at [...\libraries\joomla\application\component\helper.php:156] #8 JComponentHelper::renderComponent(com_virtuemart) called at [...\administrator\includes\application.php:153] #9 JAdministrator->dispatch() called at [...\administrator\index.php:47]
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

Milbo

Yeah, when you update your svn in the night :-) Should work now, please update
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

jjk

J1.7.1/VM2 SVN revision 4246
I updated from svn and clicked on "Renew config by file", but still get

BE: vmdebug checkValidOrderingField: programmer choosed invalid ordering m.mf_name, use p.virtuemart_product_id
FE: vmdebug checkValidOrderingField: programmer choosed invalid ordering p.pvirtuemart_product_id, use p.virtuemart_product_id

...appears to be a tricky one :-)
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

jjk

with revision 4247 I now have a slightly different result from VM Debug in BE Product List after clicking on sort by 'manufacturer' column:

vmdebug exeSortSearchListQuery error in db Var1:

Unknown column 'm.mf_name' in 'order clause' SQL=SELECT SQL_CALC_FOUND_ROWS  * FROM `jos_virtuemart_products` AS p LEFT JOIN `jos_virtuemart_product_manufacturers` ON p.`virtuemart_product_id` = `jos_virtuemart_product_manufacturers`.`virtuemart_product_id`
          LEFT JOIN `jos_virtuemart_manufacturers` ON `jos_virtuemart_manufacturers`.`virtuemart_manufacturer_id` = `jos_virtuemart_product_manufacturers`.`virtuemart_manufacturer_id`  ORDER BY m.`mf_name` ASC LIMIT 0, 30


#0 vmTrace(productsortseachr, 1) called at [...\administrator\components\com_virtuemart\helpers\vmmodel.php:358] #1 VmModel->exeSortSearchListQuery(2, * FROM `#__virtuemart_products` AS p, LEFT JOIN `#__virtuemart_product_manufacturers` ON p.`virtuemart_product_id` = `#__virtuemart_product_manufacturers`.`virtuemart_product_id` LEFT JOIN `#__virtuemart_manufacturers` ON `#__virtuemart_manufacturers`.`virtuemart_manufacturer_id` = `#__virtuemart_product_manufacturers`.`virtuemart_manufacturer_id` , , , ORDER BY m.`mf_name` , ASC, ) called at [...\administrator\components\com_virtuemart\models\product.php:270] #2 VirtueMartModelProduct->sortSearchListQuery(, , , ) called at [...\administrator\components\com_virtuemart\models\product.php:595] #3 VirtueMartModelProduct->getProductListing(, , , ) called at [...\administrator\components\com_virtuemart\views\product\view.html.php:261] #4 VirtuemartViewProduct->display() called at [...\administrator\components\com_virtuemart\controllers\product.php:68] #5 VirtuemartControllerProduct->Product() called at [...\libraries\joomla\application\component\controller.php:684] #6 JController->execute(product) called at [...\administrator\components\com_virtuemart\admin.virtuemart.php:59] #7 require_once(...\administrator\components\com_virtuemart\admin.virtuemart.php) called at [...\libraries\joomla\application\component\helper.php:156] #8 JComponentHelper::renderComponent(com_virtuemart) called at [...\administrator\includes\application.php:153] #9 JAdministrator->dispatch() called at [...\administrator\index.php:47]
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

jjk

...another small issue that might be related to ordering: In the frontend product details view, the 'Previous product title' / 'Next product title' navigation on top of the view includes unpublished products. When clicking on such an unpublished product title, it triggers a "404 The requested product does not exist." and goes to the category browse page.
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

Milbo

Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

jjk

J1.7.1/VM2 SVN revision 4251

ok - the added space character in revision 4251 seems to give me all categories with their correct browse page back :-).
With revision 4250 I had some menu links to categories which didn't show products anymore when clicked.

At present I don't have any VM Debug messages in the BE Product List and sorting basically works.
However, there is a remaining issue. Example: When I'm on page 1 of currently 25 and select sort by 'Manufacturers", the Product List is being sorted by Manufacturer. But when I click on page 2+, the sorting is lost again. I would expect that the sorting keeps the current 'sort by ...' selection, so I could move from the end of a page to the next one where more products from the same manufacturer are located.

Happy Coding  :)
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations