VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: WebStuff on October 09, 2013, 14:46:50 PM

Title: Missing argument 1 for VirtueMartModelUser::removeAddress(), removing ship addr.
Post by: WebStuff on October 09, 2013, 14:46:50 PM
Joomla! 2.5.14
VM 2.0.24

$virtuemart_userinfo_id is missing from the removeAddress() call in [SITE_ROOT]/components/com_virtuemart/controllers/user.php

function removeAddressST(){

$virtuemart_userinfo_id = JRequest::getVar('virtuemart_userinfo_id');

//Lets do it dirty for now
$userModel = VmModel::getModel('user');
$userModel->removeAddress();

$layout = JRequest::getWord('layout','edit');
$this->setRedirect( JRoute::_('index.php?option=com_virtuemart&view=user&layout='.$layout, $this->useXHTML,$this->useSSL) );
}


I changed it to the following and shipping addresses can now be removed. I don't know if there would be any other 'side-effects' to this.
function removeAddressST(){

$virtuemart_userinfo_id = JRequest::getVar('virtuemart_userinfo_id');

//Lets do it dirty for now
$userModel = VmModel::getModel('user');
$userModel->removeAddress($virtuemart_userinfo_id);

$layout = JRequest::getWord('layout','edit');
$this->setRedirect( JRoute::_('index.php?option=com_virtuemart&view=user&layout='.$layout, $this->useXHTML,$this->useSSL) );
}
Title: Re: Missing argument 1 for VirtueMartModelUser::removeAddress(), removing ship addr.
Post by: alatak on October 09, 2013, 16:35:04 PM
Hello
Txs, you are right.
I have fixed.