News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Unable to load user with ID on Ask a Question page

Started by randomdev, October 30, 2012, 04:36:18 AM

Previous topic - Next topic

randomdev

I am getting the following error on the ask a question page, however the mail still gets sent fine:

Error  JUser: :_load: Unable to load user with ID: 8321
Message Mail sent successfully

The user id listed is actually the product id for the product the question is being asked about (index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id=8321&virtuemart_category_id=62)
When I login with a normal user account instead of super admin it says error: hacking attempt.

Any ideas why this might be happening?

I notice this in the session vm debug output:
vmlastvisitedproductids
0 ⇒ 8321

and here is some more info if it helps?
Call stack
#   Function   Location
1   JSite->dispatch()   JROOT/index.php:42
2   JComponentHelper::renderComponent()   JROOT/includes/application.php:197
3   JComponentHelper::executeComponent()   JROOT/libraries/joomla/application/component/helper.php:351
4   require_once()   JROOT/libraries/joomla/application/component/helper.php:383
5   JController->execute()   JROOT/components/com_virtuemart/virtuemart.php:103
6   VirtueMartControllerProductdetails->mailAskquestion()   JROOT/libraries/joomla/application/component/controller.php:761
7   VirtueMartModelProduct->getProduct()   JROOT/components/com_virtuemart/controllers/productdetails.php:79
8   VirtueMartModelProduct->getPrice()   JROOT/administrator/components/com_virtuemart/models/product.php:514
9   calculationHelper->getProductPrices()   JROOT/administrator/components/com_virtuemart/models/product.php:1285
10   calculationHelper->setCountryState()   JROOT/administrator/components/com_virtuemart/helpers/calculationh.php:283
11   VirtueMartCart::getCart()   JROOT/administrator/components/com_virtuemart/helpers/calculationh.php:184
12   VirtueMartCart->setPreferred()   JROOT/components/com_virtuemart/helpers/cart.php:133
13   VirtueMartModelUser->getUser()   JROOT/components/com_virtuemart/helpers/cart.php:146
14   JUser::getInstance()   JROOT/administrator/components/com_virtuemart/models/user.php:151
15   JUser->__construct()   JROOT/libraries/joomla/user/user.php:269
16   JUser->load()   JROOT/libraries/joomla/user/user.php:228
17   JError::raiseWarning()   JROOT/libraries/joomla/user/user.php:886
18   JError::raise()   JROOT/libraries/joomla/error/error.php:276

After some investigation I found this in the forms html which I beleive is causing the error? If anyone else has this problem removing this line from com_virtuemart\views\askquestion\tmpl\form.php fixed the error.
<input type="hidden" name="cid[]" value="8321" />

jenkinhill

What VM version is that? Sounds like you have a dev with some test code - that line is not in 2.0.12f
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

randomdev

Sorry thought I put version in post but must have forgot, it is  2.0.6 (cant upgrade unfortunately).