VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: vmfyelloq19 on July 03, 2020, 13:38:37 PM

Title: Search shoppers - SQL error / VirtueMart 3.8.4 10335
Post by: vmfyelloq19 on July 03, 2020, 13:38:37 PM
Hi folks,

when I use the search field on
.../administrator/index.php?option=com_virtuemart&view=user

1054 Unknown column 'ui.name' in 'field list'
/htdocs/libraries/joomla/database/driver/mysqli.php:665
Call stack
#   Function   Location
1   ()   JROOT/libraries/joomla/database/driver/mysqli.php:665
2   JDatabaseDriverMysqli->execute()   JROOT/libraries/joomla/database/driver.php:1701
3   JDatabaseDriver->loadObjectList()   JROOT/administrator/components/com_virtuemart/helpers/vmmodel.php:868
4   VmModel->exeSortSearchListQuery()   JROOT/administrator/components/com_virtuemart/models/user.php:1649
5   VirtueMartModelUser->getUserList()   JROOT/administrator/components/com_virtuemart/views/user/view.html.php:232
6   VirtuemartViewUser->display()   JROOT/administrator/components/com_virtuemart/helpers/vmcontroller.php:121
7   VmController->display()   JROOT/libraries/src/MVC/Controller/BaseController.php:710
8   Joomla\CMS\MVC\Controller\BaseController->execute()   JROOT/administrator/components/com_virtuemart/virtuemart.php:76
9   require_once()   JROOT/libraries/src/Component/ComponentHelper.php:402
10   Joomla\CMS\Component\ComponentHelper::executeComponent()   JROOT/libraries/src/Component/ComponentHelper.php:377
11   Joomla\CMS\Component\ComponentHelper::renderComponent()   JROOT/libraries/src/Application/AdministratorApplication.php:101
12   Joomla\CMS\Application\AdministratorApplication->dispatch()   JROOT/libraries/src/Application/AdministratorApplication.php:159
13   Joomla\CMS\Application\AdministratorApplication->doExecute()   JROOT/libraries/src/Application/CMSApplication.php:196
14   Joomla\CMS\Application\CMSApplication->execute()

Latest VirtueMart 3.8.4 10335

Same happens when I try to sort customers.

Anything I can do about this?

TIA
Title: Re: Search shoppers - SQL error / VirtueMart 3.8.4 10335
Post by: AH on July 03, 2020, 14:26:59 PM
Yes you could change


if($this->searchTable!='juser'){
$select .= ' , ui.name as uiname ';
}


to


if($this->searchTable!='juser'){
$select .= ' , ui.* ';
}




Title: Re: Search shoppers - SQL error / VirtueMart 3.8.4 10335
Post by: vmfyelloq19 on July 03, 2020, 18:37:33 PM
Hello AH,

happen to have at hand where that change needs to go?
And wouldn't that (I suppose) be a core change that would overwritten with the next update?

TIA
Title: Re: Search shoppers - SQL error / VirtueMart 3.8.4 10335
Post by: AH on July 03, 2020, 18:47:14 PM
QuoteHello AH,

happen to have at hand where that change needs to go?
And wouldn't that (I suppose) be a core change that would overwritten with the next update?

TIA

It goes in the user model:

administrator/components/com_virtuemart/models/user.php

Yes - it will get overwritten - but I will report to the team!
Title: SOLVED Search shoppers - SQL error / VirtueMart 3.8.4 10335
Post by: vmfyelloq19 on July 03, 2020, 19:26:02 PM
Thank you!
Title: Re: Search shoppers - SQL error / VirtueMart 3.8.4 10335
Post by: Milbo on July 04, 2020, 11:40:19 AM
Quote from: AH on July 03, 2020, 14:26:59 PM
Yes you could change


if($this->searchTable!='juser'){
$select .= ' , ui.name as uiname ';
}


to


if($this->searchTable!='juser'){
$select .= ' , ui.* ';
}



I doubt that will work, just remove it.
Title: Re: Search shoppers - SQL error / VirtueMart 3.8.4 10335
Post by: AH on July 04, 2020, 20:24:22 PM
It works :-)

The reason seems to be that the name field is not created in the vm_userinfos table

I have no idea why it is not there or how to fix it (other than a manual intervention)

The ui.*  will function fine