VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: kiro789 on June 20, 2022, 16:29:33 PM

Title: bug in Virtuemart Router ?
Post by: kiro789 on June 20, 2022, 16:29:33 PM
Hello,
I have the latest version VM VirtueMart 4.0.2 10661 and Joomla 4.1.4.
I believe there is a bug in Virtuemart Router.
When I click on the image categories, for example on the home page - subcategories with images nothing happens.
Site is https://joomla4.baron.bg/.
When I disable the disable the SEF settings in Joomla global configuration, all works fine.

Regards!
Title: Re: bug in Virtuemart Router ?
Post by: mavrosxristoforos on June 21, 2022, 14:38:08 PM
I have a similar problem with the router.
Menu links to categories work normally, but links to the products don't. Instead of having the product URL as href, they have the category URL.
This happens only with SEF enabled, regardless of URL re-writing, and only when the product has its own dedicated menu item.
Joomla version 4.1.4, Virtuemart version 4.0.0.10645. (that's the latest version available on virtuemart.net today... Not sure where kiro789 got 4.0.2.10661 from)

The bug has two unwanted effects. If you visit the category page (e.g. virtuemart/headpiece/), the product links inside the category that have dedicated menu items of their own show the category URL as href instead (again virtuemart/headpiece/ instead of virtuemart/headpiece/safety-helmet).
If you visit the product page (virtuemart/headpiece/safety-helmet) by using the dedicated menu item, you see the category page, while the URL is still correctly the product detail URL (virtuemart/headpiece/safety-helmet).

Hope this helps.
Title: Re: bug in Virtuemart Router ?
Post by: jenkinhill on June 21, 2022, 15:18:13 PM
VM4.0.2 is available on http://dev.virtuemart.net/projects/virtuemart/files

AFAIK Milbo is looking at J4 router issues. I don't have issues using J3.10.9
Title: Re: bug in Virtuemart Router ?
Post by: mavrosxristoforos on June 21, 2022, 15:58:53 PM
Yes, I don't have issues on J3 either.
Thanks for letting me know about the last version location.
Title: Re: bug in Virtuemart Router ?
Post by: kiro789 on July 11, 2022, 05:54:38 AM
I have updatet to the VirtueMart 4.0.6 10690, but the problem is still exist.

Regards!
Title: Re: bug in Virtuemart Router ?
Post by: Studio 42 on July 13, 2022, 16:21:19 PM
Kiro, it seems to be a Joomla 4 issue.
The bug was not before.
I have similar problem since using Joomla 4.
Please use Joomla 3.10, if you need a working site.
Title: Re: bug in Virtuemart Router ?
Post by: mavrosxristoforos on July 14, 2022, 09:55:32 AM
I agree that most live sites may still need to use Joomla 3.10, but this must change at some point in the future.
Personally, I need Virtuemart to work for my demo site, which is ready with every other extension, including all my own Joomla extensions, and waiting for Virtuemart to fix this in order to go live.
I think you understand that it's a shame to have everything ready for Joomla 4, and not being able to demonstrate it.
Title: Re: bug in Virtuemart Router ?
Post by: mavrosxristoforos on July 29, 2022, 13:15:37 PM
Today, I got this message from the back-end of Joomla:
Joomla 3.10 has entered security only mode. Support ends 17 August 2023. Start planning to migrate to Joomla 4 today.

We appreciate all the work being done.
Title: Re: bug in Virtuemart Router ?
Post by: GJC Web Design on July 29, 2022, 14:44:34 PM
QuoteSupport ends 17 August 2023.
Still got nearly 13 months then..  :)

I think the dev team is on holiday atm but afaik the routing problems were fixed in the soon to be released 4.0.8
Title: Re: bug in Virtuemart Router ?
Post by: bindcommerce on August 05, 2022, 14:49:58 PM
I also confirm the bug, and I want to add that, if you prioritize the VM router (using the option "Strict mode" in Configuration > SEO) the links work, but you lose the ability to manage the choices that Joomla offers you (e.g. the combination with modules) and you also create an SEO problem (same contents on 2 different URLs).
Title: Re: bug in Virtuemart Router ?
Post by: chupi on August 06, 2022, 17:49:37 PM
I have the same error, does anyone know when it will be solved?
Title: Re: bug in Virtuemart Router ?
Post by: Mike J on August 09, 2022, 00:46:32 AM
Hello Chupi,

It's been reported that there hasn't been any progress in the public SVN for 4.0.8 for 30+ days but some say that they have seen progress in the VM DEV chat... 

... A word from whoever is driving the bus regarding the path forward and ETAs would be helpful.

Unfortunately, your guess is as good as mine at this stage.

If you're running a live production site that needs to take orders, try to build on J! 3.10.10 / VM 4.0.2 10661 and await VM 4.0.8 IMHO.
Title: Re: bug in Virtuemart Router ?
Post by: GJC Web Design on August 10, 2022, 14:01:09 PM
the last com_virtuemart.4.0.7.10693 was shared on the dev chat on the 20th July so should all start again soon...
Title: Re: bug in Virtuemart Router ?
Post by: Mike J on August 11, 2022, 03:02:00 AM
Hello GJC,

... Hopefully but 3 weeks of nothing... And I need to get onto J4! for other reasons.

Have been a proud VM user for 10 years - have a number of paid plugins.

I'm not complaining 'cause it's free software but I'm unable to wait indefinitely.

Looks like my time has come to sign off.

Thanks everyone for your assistance. Has been a great ride.
Title: Re: bug in Virtuemart Router ?
Post by: mavrosxristoforos on August 11, 2022, 11:57:16 AM
I think it's best to wait a little bit, since it's August. I'm sure the dev team will have this new version released soon.
Title: Re: bug in Virtuemart Router ?
Post by: ocram44 on September 15, 2022, 10:07:02 AM
I encontered this strange behavoiur in Joomla 4.2.2, Virtuemart 4.0.4: After adding a product in the cart a box appears confirming that the product was added to the cart. The box has two button links: "continue shopping" and "go to cart". Both links point to the current page which is correct for "continue shopping" but not for "go to cart". This seems to be a bug in the Virtuemart Router. Is it the same as above? In Joomla 3.10.x it worked fine. Same behaviour when the cart is empty: a button link should lead back to the category shop, but instead it leads to the same page again.
Thank you for any help.
Title: Re: bug in Virtuemart Router ?
Post by: hazael on September 15, 2022, 13:47:31 PM
Quote from: ocram44 on September 15, 2022, 10:07:02 AM
This seems to be a bug in the Virtuemart Router.

Virtuemart doesn't have a problem with that. This is apparently a problem with your custom template or an improperly configured SEF plugin
Title: Re: bug in Virtuemart Router ?
Post by: ocram44 on September 15, 2022, 17:36:05 PM
You are right, it is not a bug in the virtuemart router. It seems to be a bug in the Joomla Router. I am using the System SEF Plugin, nothing to configure there and my template is also not causing the problem.
Title: Re: bug in Virtuemart Router ?
Post by: hazael on September 16, 2022, 10:48:48 AM
And after disabling SEF - what is the structure of links to this cart? Are you moved to the cart when you run this link?
Cart link shouldn't be a problem on Joomla 4. I have several pages on my original templates and it works fine.
Generally in Joomla, you should create a link to the shopping cart in the menu builder. If you do not want to publish it on the website, you can create a separate invisible category for such link.
Title: Re: bug in Virtuemart Router ?
Post by: ocram44 on September 16, 2022, 11:08:28 AM
Disabling SEF gives the the correct long links. The Problem is in the Joomla Router. I posted it in the Joomla forum:
https://forum.joomla.org/viewtopic.php?f=816&t=996524
Title: Re: bug in Virtuemart Router ?
Post by: mavrosxristoforos on September 16, 2022, 16:43:14 PM
It is true that the Joomla router has changed, but components have adapted and work fine in J4.
When disabling SEF, I don't think the Virtuemart router is used at all. That's why it works. I may be wrong.
Title: Re: bug in Virtuemart Router ?
Post by: ocram44 on September 16, 2022, 18:38:09 PM
With SEF enabled the Joomla SEF Router causes the problem, not the VirtueMart SEF Router. The problem is described in the Joomla Forum. See above.
Title: Re: bug in Virtuemart Router ?
Post by: mavrosxristoforos on September 16, 2022, 20:37:43 PM
I saw your post on the Joomla forum.
However, maintaining the menu Itemid is the expected behavior unless it is explicitly set by the provided URL.
Title: Re: bug in Virtuemart Router ?
Post by: ocram44 on September 16, 2022, 20:57:22 PM
The component (here Virtuemart) changes the menu itemid but the Joomla Router does not update the menu itemid to the changed one. In 3.10.x it did. That is all what I know. What is intended or not and which side has to change what is beyond my knowledge. I hope someone knows more about this problem and how to solve it.
Title: Re: bug in Virtuemart Router ?
Post by: mavrosxristoforos on September 20, 2022, 11:47:25 AM
The bug, as far as I can identify Virtuemart code, is in components/com_virtuemart/sublayouts/products.php. The supplied $ItemidStr points to the category menu item instead of the product menu item, which then confuses the router. If Joomla 4 component routing didn't work correctly, wouldn't they have seen it already? Instead, it is now the component's responsibility to properly identify the target menu item to be used, which makes some sense from a content-agnostic, component-independent, generic router's point of view.

Of course, I am referring to the original problem mentioned in this post, the one that shows the category view instead of products.

Interestingly enough, I made another test to confirm my point. I manually linked to the product using the correct menu item id from an independent view (even within articles it would work I guess now) and the Virtuemart router points to the correct menu item, with the correct product view showing up. [SEF enabled]

So, theoretically, the solution would either be to overwrite the menu item's properties in the router if such options exist in the URL or include the correct menu item ID in the first place. Probably both would be required to remedy the existing situation that probably includes dozens of templates and thousands of websites with existing template overrides of Virtuemart's views.
Title: Re: bug in Virtuemart Router ?
Post by: kiro789 on September 28, 2022, 15:19:19 PM
But this is not some small problem, in this case we can not use fully VM with Joomla 4. So is the problem in Joomla or VM ?
Title: Re: bug in Virtuemart Router ?
Post by: kiro789 on September 28, 2022, 15:43:32 PM
I just installed VirtueMart 4.0.7 10699 on Joomla  ‎4.2.3 and the problem was solved :)
Thank you very much!!!

Regards!
Title: Re: bug in Virtuemart Router ?
Post by: GJC Web Design on September 29, 2022, 15:38:36 PM
latest is https://dev.virtuemart.net/attachments/download/1330/com_virtuemart.4.0.7.10711_package_or_extract.zip
Title: Re: bug in Virtuemart Router ?
Post by: mavrosxristoforos on September 30, 2022, 20:14:17 PM
Excellent news! I confirm the fix. Hurray!

There's still a small warning, though, just FYI:
Warning: Undefined array key "Itemid" in .../components/com_virtuemart/router.php on line 334
Title: Re: bug in Virtuemart Router ?
Post by: Milbo on October 02, 2022, 01:46:29 AM
Quote from: mavrosxristoforos on September 30, 2022, 20:14:17 PM
Excellent news! I confirm the fix. Hurray!

There's still a small warning, though, just FYI:
Warning: Undefined array key "Itemid" in .../components/com_virtuemart/router.php on line 334
considered (maybe fixed next version, generic fix added). Last version (without this fix though, https://dev.virtuemart.net/attachments/1332/com_virtuemart.4.0.7.10714_package_or_extract.zip)
Title: Re: bug in Virtuemart Router ?
Post by: ocram44 on November 15, 2022, 18:14:06 PM
Quote from: ocram44 on September 15, 2022, 10:07:02 AM
I encontered this strange behavoiur in Joomla 4.2.2, Virtuemart 4.0.4: After adding a product in the cart a box appears confirming that the product was added to the cart. The box has two button links: "continue shopping" and "go to cart". Both links point to the current page which is correct for "continue shopping" but not for "go to cart". This seems to be a bug in the Virtuemart Router. Is it the same as above? In Joomla 3.10.x it worked fine. Same behaviour when the cart is empty: a button link should lead back to the category shop, but instead it leads to the same page again.
Thank you for any help.

The new version 4.0.7 of VirtueMart solved this problem.
Thank you!