Author Topic: VM 202 - 2.0.20b - COM_VIRTUEMART_ASSIGN_VM_TO_MENU  (Read 7721 times)

lysov

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 105
    • Litera ltd
VM 202 - 2.0.20b - COM_VIRTUEMART_ASSIGN_VM_TO_MENU
« on: March 16, 2012, 20:38:48 pm »
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

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 105
    • Litera ltd
 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

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 66
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

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 105
    • Litera ltd
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

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 105
    • Litera ltd
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

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 105
    • Litera ltd
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

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 66
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

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 105
    • Litera ltd
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

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 105
    • Litera ltd
Subrelease VirtueMart 2.0.3H: why you do not like the operator "LIKE"?

lysov

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 105
    • Litera ltd
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")

lysov

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 105
    • Litera ltd
Re: VirtueMart 2.0.6 - COM_VIRTUEMART_ASSIGN_VM_TO_MENU <-- IMPORTANT & NEW
« Reply #10 on: April 17, 2012, 09:05:20 am »
VM 2.0.6
With the update of each new release I have to edit the router.php

lysov

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 105
    • Litera ltd
Up - VM 2.0.7
There will be 2 months soon ...

lysov

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 105
    • Litera ltd
Re: VirtueMart 2.0.7E - COM_VIRTUEMART_ASSIGN_VM_TO_MENU
« Reply #12 on: June 12, 2012, 07:46:25 am »
Up: 207E
It took three months...

lysov

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 105
    • Litera ltd
Re: VM 204 - 208 - COM_VIRTUEMART_ASSIGN_VM_TO_MENU
« Reply #13 on: July 06, 2012, 12:39:26 pm »
208с the same...
Should I hope this correction?

lysov

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 105
    • Litera ltd
Re: VM 204 - 208 - COM_VIRTUEMART_ASSIGN_VM_TO_MENU
« Reply #14 on: July 14, 2012, 08:47:51 am »
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


VirtueMart Forum

Re: VM 204 - 208 - COM_VIRTUEMART_ASSIGN_VM_TO_MENU
« Reply #14 on: July 14, 2012, 08:47:51 am »