Author Topic: [SOLVED] VM 3.0.14 - invalid routing  (Read 2446 times)

n3t

  • Beginner
  • *
  • Posts: 32
  • A beginner
[SOLVED] VM 3.0.14 - invalid routing
« on: March 16, 2016, 10:16:11 am »
Hi,

after upgrading VM 3.0.12 to 3.0.14 (Joomla 3.4.8) I found routing is not working correctly. It works perfectly to find proper pages, however it fails to detect 404 error.
My config is
- Virtuemart Front page is my home menu item
- means that urls shoud look like www.example.com/category-name, www.example.com/category-name/subcategory-name, www.example.com/category-name/subcategory-name/product-name - this works perfectly
- before upgrade url www.example.com/wrong-category-name results in 404 (in my case causing Joomla redirect plugin to redirect to the page I need)
- after upgrade url www.example.com/wrong-category-name (or www.example.com/whatever/else) results in displaying category page with empty category - All products

This is not expected behavior, is it brings infinite number of duplicate content. If item (or category) is unpublished, it will not work as expected - showing 404 page - but shows list of products.

Pavel

n3t

  • Beginner
  • *
  • Posts: 32
  • A beginner
Re: VM 3.0.14 - invalid routing
« Reply #1 on: March 16, 2016, 10:26:51 am »
Note:

"Use product link suffix", "Translate Strings", "Use Product and Category IDs", "Use full category tree for product links" and "Enable VirtueMart 404 error handling" options doesn't have any influence to this behavior.
If "SEO Disabled" option is checked, the result is still wrong (no 404 error), however bit different - it shows Vm frontpage instead of category view.

I checked this behavior also on clean installation, with VM frontapge menu item not set as homepage, and the result is same.

After replacing router.php by the one from VM 3.0.12 it starts to wok correctly (www.example.com/wrong-category-name bresults in 404).

Ghost

  • Jr. Member
  • **
  • Posts: 422
Re: VM 3.0.14 - invalid routing
« Reply #2 on: March 16, 2016, 12:07:44 pm »
Could you please test this. Change:

Code: [Select]
if($catId!==false){ to:
Code: [Select]
if($catId!=false){ on line 675 of router.php (for VM 3.0.14)

n3t

  • Beginner
  • *
  • Posts: 32
  • A beginner
Re: VM 3.0.14 - invalid routing
« Reply #3 on: March 16, 2016, 12:13:41 pm »
Hi ghost,

thanks for fast reply, yes this change solved the issue.

Will be this included in official VM?

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 10124
  • VM3.9 Eagle Owl
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: VM 3.0.14 - invalid routing
« Reply #4 on: March 16, 2016, 20:25:14 pm »
yepp, n3t

Thank you Ghost, for the fast solution
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

n3t

  • Beginner
  • *
  • Posts: 32
  • A beginner
Re: VM 3.0.14 - invalid routing
« Reply #5 on: March 16, 2016, 21:59:19 pm »
Thanks Milbo

ptrouw

  • Jr. Member
  • **
  • Posts: 129
Re: [SOLVED] VM 3.0.14 - invalid routing
« Reply #6 on: June 28, 2016, 11:12:43 am »
Hi,
It seems this code, if($catId!==false){, is still wrong in 3.0.16.