Author Topic: Joomla 4 and VM 3.8.9 10560 page can't be found errors  (Read 1009 times)

ssc3

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 162
    • Online Store Plugins
Joomla 4 and VM 3.8.9 10560 page can't be found errors
« on: November 12, 2021, 00:29:38 am »
Getting occasional page can't be found errors in Joomla 4 and VM 3.8.9 10560

The cause seems to be be passing messages via the redirect function which is deprecated.

However enqueueMessage() can be used instead.

in cart.php change

Code: [Select]
//$app->redirect(JRoute::_('index.php?option=com_virtuemart&view=cart&task='.$task,$this->useXHTML,$this->useSSL), $msg);
$app->enqueueMessage($msg);
$app->redirect(JRoute::_('index.php?option=com_virtuemart&view=cart&task='.$task,$this->useXHTML,$this->useSSL));

Code: [Select]
//$app->redirect(JRoute::_($relUrl,$this->useXHTML,$this->useSSL), $redirectMsg);
$app->enqueueMessage($redirectMsg);
$app->redirect(JRoute::_($relUrl,$this->useXHTML,$this->useSSL));

Code: [Select]
//$app->redirect(JRoute::_('index.php?option=com_virtuemart&view=cart'.$layoutName, FALSE), vmText::_('COM_VIRTUEMART_CART_CHECKOUT_DONE_CONFIRM_ORDER'));
$app->enqueueMessage(vmText::_('COM_VIRTUEMART_CART_CHECKOUT_DONE_CONFIRM_ORDER'));
$app->redirect(JRoute::_('index.php?option=com_virtuemart&view=cart'.$layoutName, FALSE));

Code: [Select]
// $app->redirect(JRoute::_('index.php?option=com_virtuemart&view=cart'.$this->getLayoutUrlString(), FALSE), vmText::_('COM_VIRTUEMART_CART_CHECKOUT_DATA_CHANGED'));
$app->enqueueMessage(vmText::_('COM_VIRTUEMART_CART_CHECKOUT_DATA_CHANGED'));
$app->redirect(JRoute::_('index.php?option=com_virtuemart&view=cart'.$this->getLayoutUrlString(), FALSE));

Code: [Select]
// $app->redirect(JRoute::_('index.php?option=com_virtuemart&view=cart'.$this->getLayoutUrlString(), FALSE), vmText::_('COM_VIRTUEMART_CART_CHECKOUT_DATA_NOT_VALID'));
$app->enqueueMessage(vmText::_('COM_VIRTUEMART_CART_CHECKOUT_DATA_NOT_VALID'));
$app->redirect(JRoute::_('index.php?option=com_virtuemart&view=cart'.$this->getLayoutUrlString(), FALSE));

edited to add other redirects in cart.php . Enqueue message before redirect.

These are the redirects causing the most common problems during checkout, but there are other similar redirects used elsewhere.