News:

Support the VirtueMart project and become a member

Main Menu

Media file manager

Started by BaidareW, March 09, 2012, 19:53:55 PM

Previous topic - Next topic

BaidareW

Hello,

in joomla 2.5.2 and virtuemart 2.0.3b (also it was the same 2.0.2) clicking on media file manager icon (in product list view on backend) gives empty page and error "vmError: exeSortSearchListQuery Column 'ordering' in order clause is ambiguous SQL=SELECT SQL_CALC_FOUND_ROWS `yy5qv_virtuemart_medias`.`virtuemart_media_id` as virtuemart_media_id FROM `yy5qv_virtuemart_product_medias` LEFT JOIN `yy5qv_virtuemart_medias` ON `yy5qv_virtuemart_medias`.`virtuemart_media_id`=`yy5qv_virtuemart_product_medias`.`virtuemart_media_id` and `virtuemart_product_id` = "27" WHERE `virtuemart_product_id` = "27" ORDER BY ordering DESC LIMIT 0, 3"

What could be the problem ?

d0ublezer0

I have the same error with same config

d0ublezer0


d0ublezer0

#3
This error means that for the sort field has not been explicitly specified table in which the field is located.
... ORDER BY `in this place shold be table name`.`ordering` DESC LIMIT 0, 30
to solve this problem change the file administrator\components\com_virtuemart\models\media.php
on line 42-43 (for 2.0.3.e) change code to:

$this->addvalidOrderingFieldName(array('`#__virtuemart_medias`.`ordering`'));
$this->_selectedOrdering = '`#__virtuemart_medias`.`ordering`';

BaidareW


d0ublezer0

Please, mark this topic as "Solved"

Milbo

no is not solved.

This is an error in the core and hte reason is technical correct, but it is imho not the right fix. You use the wrong table and then you use the ordering of hte product and not of the medias. But good to know, will be fixed in 20 minutes.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Milbo

I implemented two fixes

First I enhanced the ordering in general, we can add now a prefix table
second, I deleted the ordering of the media itself. Medias are still orderable but only related to some item like product or category
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

d0ublezer0

Milbo, thank you for your attention to this problem.
My solution was presented as temporary.

I would also like to draw your attention to the fact that, after saving media, the media manager filter disappears, and we again see all the media files, and not related to one previously selected product.

BaidareW

Fix not working. After upgrade from 2.0.3e to 203G error comes again. Last time fixed with solution in this thread.

d0ublezer0

This fix works (by itself).
Just when you upgrade to 2.0.3G, this fix has been erased, because in the version G it is not implemented.
Milbo said, that the problems can be solved not so simple.

Perhaps, it was deeper than I expected.