Menu Content

Support

> Forums, FAQs & Paid Support
Welcome, Guest
Username Password: Remember me

Bug in JoomSEF VirtueMart SEF Extension
(1 viewing) (1) Guest
Support forum for customers who have purchased JoomSEF 3 (Joomla 1.5 compatible). Archive only, no new post can be added.

NOTE: This category has been locked. If you have purchased paid version, please, use our Support Ticket system instead. If you are using free edition, please see the Community Support section.
  • Page:
  • 1

TOPIC: Bug in JoomSEF VirtueMart SEF Extension

Bug in JoomSEF VirtueMart SEF Extension 14 years, 7 months ago #11861

Hi Everybody,

I think there is a serious bug in the VirtueMart SEF Extension.

I have the following original url : "index.php?option=com_virtuemart&category_id=7&flypage=my_flypage.tpl&manufacturer_id=1&page=shop.product_details&product_id=1"
It should be replaced by a Sef url.

There is a function called "getSefUrlFromDatabase(&$uri)" in VirtueMart SEF Extension's file "com_virtuemart.php" which, as its name suggest, tries to get a sef url from the database instead of original one.

It uses the following syntax for checking:
$query = "SELECT `sefurl` FROM `#__sefurls` WHERE `origurl` REGEXP '" . addslashes($regexp) . "'" . $where;
In my case it will be translated to:
SELECT `sefurl`
FROM `jos_sefurls`
WHERE `origurl`
REGEXP 'index\\.php\\?option=com_virtuemart&category_id=[^&]*&flypage=my_flypage\\.tpl&manufacturer_id=1&page=shop\\.product_details&product_id=1'

The problem is that the above mentioned syntax will result many rows if you have products with id begining with 1 like 1,11,13,14, ..,111 etc.

    index.php?option=com_virtuemart&category_id=7&flypage=my_flypage.tpl&manufacturer_id=1&page=shop.product_details&product_id=11

    index.php?option=com_virtuemart&category_id=19&flypage=my_flypage.tpl&manufacturer_id=1&page=shop.product_details&product_id=13

    index.php?option=com_virtuemart&category_id=7&flypage=my_flypage.tpl&manufacturer_id=1&page=shop.product_details&product_id=14

    index.php?option=com_virtuemart&category_id=7&flypage=my_flypage.tpl&manufacturer_id=1&page=shop.product_details&product_id=1


In this way the replaced sef url will be incorrect.

I think you should put the "$" pattern at the end of regexp:
$regexp.="$";
$query = "SELECT `sefurl` FROM `#__sefurls` WHERE `origurl` REGEXP '" . addslashes($regexp) . "'" . $where;
So it will be translated to:
SELECT `sefurl`
FROM `jos_sefurls`
WHERE `origurl`
REGEXP 'index\\.php\\?option=com_virtuemart&category_id=[^&]*&flypage=my_flypage\\.tpl&manufacturer_id=1&page=shop\\.product_details&product_id=1$'

I'm I correct?

I'm using the following configuration:
Joomla 1.5.15
VirtueMart 1.1.4
JoomSEF 3.6.2
JoomSEF VirtueMart SEF Extension 2.0.20
The topic has been locked.

Re:Bug in JoomSEF VirtueMart SEF Extension 14 years, 7 months ago #11872

  • dajo
  • OFFLINE
  • Posts: 5069
Hello,

Thanks for your report, we will fix this in next version.

Best regards,
ARTIO Support Team
ARTIO Support Team
The topic has been locked.
  • Page:
  • 1
User Login Empty