News:

Looking for documentation? Take a look on our wiki

Main Menu

VM 202 - 2.0.20b - COM_VIRTUEMART_ASSIGN_VM_TO_MENU

Started by lysov, March 16, 2012, 20:38:48 PM

Previous topic - Next topic

lysov

There is error in the VM router: when VM is used for only one language comes the following error "Assign the component VirtueMart to a menu item". To avoid this please replace line into router.php from
$query = 'SELECT * FROM `#__menu`  where `link` like "index.php?option=com_virtuemart%" and client_id=0 and published=1 and (language="*" or language="'.$this->langTag.'")';
to
$query = 'SELECT * FROM `#__menu`  where `link` like "index.php?option=com_virtuemart%" and client_id=0 and published=1 and (language = "*" or language LIKE "'.$this->langTag.'")';

Due to the different character cases in the langTag, the original query does not work properly for those cases when a VM-component is assigned to the menu for only one language (not for "*").

Thx

lysov

 2.0.3E - the same bug too  :(

I have VM assigned to a menu item for Russian only and VM router reports "Assign the component VirtueMart to a menu item".

osp

Hi Lysov,

please check your menu item links in DB. Slash in query you added indicates some malformed path I think...
Can you review this?

Thx

lysov

The sign "backslash" only escapes the question mark (mysql it extends to any character). But the main thing is that the equal sign in the query is incorrect, in my case, using LIKE operator, I get a non-empty result set, and the use of "=" the empty result set is empty. And searching by the messages on the forum I am not alone in facing the situation "Assign the component VirtueMart to a menu item" and non-working router. Try this by phpMyAdmin with only one language  (without the lang "*")

lysov

After a system upgrade (to version 5.5.21 Mysql and php to version 5.3.10) were both queries return the same result set! But you should still use my version of the query - it works correctly on older versions of software (5.5.20 and 5.3.9).

lysov

With the "\?", I made ​​a mistake, but the operator LIKE should be used instead "=". The correct version of the query is
$query = 'SELECT * FROM `#__menu`  where `link` like "index.php?option=com_virtuemart%" and client_id=0 and published=1 and (language LIKE "*" or language LIKE "'.$this->langTag.'")';

osp

It does not make a sense to me. Asterisk is not a wildcard, so if = or like is used odes not matter ( like "*" yelds the same results as ="*")
So then this can only be true if the lang tag is different in case ( ru instead of RU)?

Can you check this?

lysov

Yeah, I've already checked. The sign "=" and the operator LIKE is not always the same thing, that's the whole point - http://stackoverflow.com/questions/1003381/difference-between-like-and-in-mysql. Specifically in my case, when using MySQL version 5.5.20 (and php 5.3.9), the query works properly with using LIKE operator. This was the reason for creating topic: I was puzzled that the system is requested to assign a link in the menu for the VM.

lysov

Subrelease VirtueMart 2.0.3H: why you do not like the operator "LIKE"?

lysov

VirtueMart 2.0.5 rc
MySQL: 5.5.21
PHP: 5.3.10

There is my query (from vmdebug()):
SELECT * FROM `vm_without_bugs_menu` where `link` like "index.php?option=com_virtuemart%" and client_id=0 and published=1 and (language="*" or language="ru_ru")
It returns empty result set. Неre is my data (attached) - the lang tag is 'ru-RU', not 'ru_ru':
119    mainmenu    The First step    first-step       catalog/first-steps    index.php?option=com_virtuemart&view=category&virt...    component    1    120    2    10082    0    0    0000-00-00 00:00:00    0    1       1    {"menu-anchor_title":"","menu-anchor_css":"","menu...   16    17    0    ru-RU

The query should be
SELECT * FROM `#__menu` where `link` like "index.php?option=com_virtuemart%" and client_id=0 and published=1 and (language="*" or language LIKE "ru_ru")

[attachment cleanup by admin]

lysov

VM 2.0.6
With the update of each new release I have to edit the router.php

lysov


lysov


lysov

208с the same...
Should I hope this correction?

lysov

VM v2.0.8d released and I'm still having the same issue shown here...


J! 2.5.6
MySQL  5.5.24
PHP    5.3.14