VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: lysov on March 11, 2012, 13:44:52 PM

Title: VM 203B, CMS in Debug Mode - Error #500
Post by: lysov on March 11, 2012, 13:44:52 PM
Joomla 252, VM 203 - Joomla in the Debug Mode. When I trying to open BE product list, system report about following error
500 - An error has occurred.
JDatabaseMySQLi::query: 1052 - Column 'virtuemart_shoppergroup_id' in field list is ambiguous SQL=SELECT virtuemart_shoppergroup_id FROM `lt_virtuemart_vmusers` as `u` LEFT OUTER JOIN `lt_virtuemart_vmuser_shoppergroups` AS `vx` ON `u`.`virtuemart_user_id` = `vx`.`virtuemart_user_id` LEFT OUTER JOIN `lt_virtuemart_shoppergroups` AS `sg` ON `vx`.`virtuemart_shoppergroup_id` = `sg`.`virtuemart_shoppergroup_id` WHERE `u`.`virtuemart_user_id` = "42"

The URL looks like http://www.site.local/administrator/index.php?option=com_virtuemart&view=product
Title: Re: VM 203B, CMS in Debug Mode - Error #500
Post by: lysov on March 11, 2012, 21:25:31 PM
And some potential bugs in constructions "switch (xxxxx) {
                case 'xxxxx';
                break;
                default ;

For example, router.php contains
        switch ($view) {
                case 'virtuemart';
                                . . .
                case 'category';
                                . . .
                default ;

Try search like this:
$ grep -r 'default ;'  .
./components/com_virtuemart/router.php:         default ;
./administrator/components/com_virtuemart/models/product.php:                 default ;
Title: Re: VM 203B, CMS in Debug Mode - Error #500
Post by: Milbo on March 12, 2012, 10:46:50 AM
The first bug is afaik fixed in the svn.

The other thing. What is the problem with it? default dont need a break, it is the last entry
Title: Re: VM 203B, CMS in Debug Mode - Error #500
Post by: lysov on March 12, 2012, 13:45:29 PM
Only two variants of the syntax for control structures are supported with switches. The use of undocumented options (such as "case 1;") may cause undesired operation code, like in the VM  :) For more information, see syntax for control structures http://www.php.net/manual/en/control-structures.alternative-syntax.php  :)
Try to set "Error Reporting" to "Development" (Joomla Global Configuration) and you'll be surprised at the number of VM errors...