Hi,
Just updated my VM installation to the latest 3.8.6 10373
After the update, when in products in the back-end and if I apply any search filter I get the above error.
Any ideas on what could have gone wrong and how to fix it?
Thanks!
unfortunately I have the same problem :-(
have you tried "install or update tables" in tools and migration ?
Yep, no luck...
Even optimised db from within VM tools, repaired tables in phpMyAdmin....
Go to Joomla Global Configuration and enable "Debug System" option. Next set "Error Reporting" option to "Development" mode.
Go to VirtueMart Configuration and set "PHP Developer mode" option as "For all".
Now go to the error page, take a screenshot and post it here.
VirtueMart 3.8.6 10373
Joomla! 3.9.23
PHP 7.4
On same hosting VirtueMart 3.6.10 10211 working properly.
I have the same error and here is the error: PHP Notice: Array to string conversion in /administrator/components/com_virtuemart/models/product.php on line 478
And the call stack:
Call stack
# Function Location
1 () JROOT/libraries/joomla/database/driver/mysqli.php:665
2 JDatabaseDriverMysqli->execute() JROOT/libraries/joomla/database/driver.php:1550
3 JDatabaseDriver->loadColumn() JROOT/administrator/components/com_virtuemart/helpers/vmmodel.php:865
4 VmModel->exeSortSearchListQuery() JROOT/administrator/components/com_virtuemart/models/product.php:833
5 VirtueMartModelProduct->sortSearchListQuery() JROOT/administrator/components/com_virtuemart/models/product.php:1992
6 VirtueMartModelProduct->getProductListing() JROOT/administrator/components/com_virtuemart/views/product/view.html.php:394
7 VirtuemartViewProduct->display() JROOT/administrator/components/com_virtuemart/helpers/vmcontroller.php:121
8 VmController->display() JROOT/libraries/src/MVC/Controller/BaseController.php:710
9 Joomla\CMS\MVC\Controller\BaseController->execute() JROOT/administrator/components/com_virtuemart/virtuemart.php:76
10 require_once() JROOT/libraries/src/Component/ComponentHelper.php:402
11 Joomla\CMS\Component\ComponentHelper::executeComponent() JROOT/libraries/src/Component/ComponentHelper.php:377
12 Joomla\CMS\Component\ComponentHelper::renderComponent() JROOT/libraries/src/Application/AdministratorApplication.php:101
13 Joomla\CMS\Application\AdministratorApplication->dispatch() JROOT/libraries/src/Application/AdministratorApplication.php:159
14 Joomla\CMS\Application\AdministratorApplication->doExecute() JROOT/libraries/src/Application/CMSApplication.php:196
15 Joomla\CMS\Application\CMSApplication->execute() JROOT/administrator/index.php:51
PHP-Version 7.3.21
Joomla version, 3.9.23.
VirtueMart 3.8.6 10373
Trouble shooting done so far: Deactivated plugins, reinstall Joomla core files. Fix database. Install and if necessary update missing table . Clear cache. Tested on a test server with same template and version and error could not be reproduced.
Note for anyone with the issue: please post your php, Joomla and virtuemart version.
I can't recreate it on
PHP-Version 7.3.21
Joomla version, 3.9.23.
VirtueMart 3.8.6 10373
line 478 is $where[] = ' `pc`.`virtuemart_category_id` = ' . $virtuemart_category_id;
so somehow $virtuemart_category_id must be an array -- is it possible now to have the category select as a multiselect??
and why does it now say "Unselect any product category" ?
"and why does it now say "Unselect any product category" ?"
"is it possible now to have the category select as a multiselect??"
New functionality - enabled by hidden config
Hidden config? This is great! New functionality - even better.
But how we can solve this?
I think the problem only occur when you use subproducts (product is children of)
Quote from: k2bmedia on November 25, 2020, 11:15:31 AM
I think the problem only occur when you use subproducts (product is children of)
I don't have any children products. And have this situation on two sites, with different articles and structure.
Quote from: igormoor on November 25, 2020, 10:42:45 AM
Hidden config? This is great! New functionality - even better.
But how we can solve this?
No idea - what I was answering was GJC's questions regarding the screen shots
Quote from: GJC Web Design on November 25, 2020, 10:29:26 AM
I can't recreate it on
PHP-Version 7.3.21
Joomla version, 3.9.23.
VirtueMart 3.8.6 10373
Hello John
I have same issue:
PHP-Version 7.3.24
Joomla version, 3.9.23.
VirtueMart 3.8.6 10373
Also, site product images "disappeared" which is why I wanted to check in backend.
See: https://back3.4footyfans.com
Here it is
Hello,
Same Problem Here.
After the update i cannot search,filter products or change page on back-end virtuemart products page.
Anyone figured it out?
PHP 7.4.12
Joomla: Joomla! 3.9.23 Stable [ Amani ] 24-November-2020 15:00 GMT
Database Version: 5.5.5-10.3.17-MariaDB
VirtueMart 3.8.6 10373
Same problem I think Child but i don't have child category
Open - administrator/components/com_virtuemart/models/product.php
Find the exact following codes between lines 473 to 479:
if(!empty($cats)){
$joinCategory = TRUE;
$cats .= $virtuemart_category_id;
$where[] = ' `pc`.`virtuemart_category_id` IN ('.$cats.') ';
} else {
$where[] = ' `pc`.`virtuemart_category_id` = ' . $virtuemart_category_id;
}
Replace above by:
if(!empty($cats)) {
$joinCategory = TRUE;
$cats .= $virtuemart_category_id;
$where[] = ' `pc`.`virtuemart_category_id` IN ('.$cats.') ';
} else {
if(is_array($virtuemart_category_id)) {
$category_id = array_filter(array_map('intval', $virtuemart_category_id));
if(!empty($category_id))
{
$where[] = ' `pc`.`virtuemart_category_id` IN (' . implode(',', $category_id) . ')';
}
} else {
$where[] = ' `pc`.`virtuemart_category_id` = ' . $virtuemart_category_id;
}
}
This will fix the issue for the time being. A permanent solution is expected in the next release.
Thank you Jumbo! that did the trick!
Looking forward to the next release :-)
Quote from: Jumbo! on November 25, 2020, 14:28:44 PM
Open - administrator/components/com_virtuemart/models/product.php
Find the exact following codes between lines 473 to 479:
if(!empty($cats)){
$joinCategory = TRUE;
$cats .= $virtuemart_category_id;
$where[] = ' `pc`.`virtuemart_category_id` IN ('.$cats.') ';
} else {
$where[] = ' `pc`.`virtuemart_category_id` = ' . $virtuemart_category_id;
}
Replace above by:
if(!empty($cats)) {
$joinCategory = TRUE;
$cats .= $virtuemart_category_id;
$where[] = ' `pc`.`virtuemart_category_id` IN ('.$cats.') ';
} else {
if(is_array($virtuemart_category_id)) {
$category_id = array_filter(array_map('intval', $virtuemart_category_id));
if(!empty($category_id))
{
$where[] = ' `pc`.`virtuemart_category_id` IN (' . implode(',', $category_id) . ')';
}
} else {
$where[] = ' `pc`.`virtuemart_category_id` = ' . $virtuemart_category_id;
}
}
This will fix the issue for the time being. A permanent solution is expected in the next release.
Thank you but this didn't solve the problem for me. Same error when filtering by category, search or when I change page.
Jumbo! Thanks it worked for me.
If it doesn't work maybe try logigng out the admin panel and log back in again?
Quote from: ruleragency on November 25, 2020, 15:00:57 PM
Quote from: Jumbo! on November 25, 2020, 14:28:44 PM
Open - administrator/components/com_virtuemart/models/product.php
Find the exact following codes between lines 473 to 479:
if(!empty($cats)){
$joinCategory = TRUE;
$cats .= $virtuemart_category_id;
$where[] = ' `pc`.`virtuemart_category_id` IN ('.$cats.') ';
} else {
$where[] = ' `pc`.`virtuemart_category_id` = ' . $virtuemart_category_id;
}
Replace above by:
if(!empty($cats)) {
$joinCategory = TRUE;
$cats .= $virtuemart_category_id;
$where[] = ' `pc`.`virtuemart_category_id` IN ('.$cats.') ';
} else {
if(is_array($virtuemart_category_id)) {
$category_id = array_filter(array_map('intval', $virtuemart_category_id));
if(!empty($category_id))
{
$where[] = ' `pc`.`virtuemart_category_id` IN (' . implode(',', $category_id) . ')';
}
} else {
$where[] = ' `pc`.`virtuemart_category_id` = ' . $virtuemart_category_id;
}
}
This will fix the issue for the time being. A permanent solution is expected in the next release.
Thank you but this didn't solve the problem for me. Same error when filtering by category, search or when I change page.
Then you must have changed the wrong codes. Category filtering works fine now.
Modified file attached.
Thanks, Jumbo
Products now open in the backend.
However, Product Price, image(s), Category(ies) and Manufacturer are now empty.
TIA
Work fine. Thanks.
This is permanent solution or it will be some update soon?
Quote from: Jumbo! on November 25, 2020, 15:07:34 PM
Quote from: ruleragency on November 25, 2020, 15:00:57 PM
Quote from: Jumbo! on November 25, 2020, 14:28:44 PM
Open - administrator/components/com_virtuemart/models/product.php
Find the exact following codes between lines 473 to 479:
if(!empty($cats)){
$joinCategory = TRUE;
$cats .= $virtuemart_category_id;
$where[] = ' `pc`.`virtuemart_category_id` IN ('.$cats.') ';
} else {
$where[] = ' `pc`.`virtuemart_category_id` = ' . $virtuemart_category_id;
}
Replace above by:
if(!empty($cats)) {
$joinCategory = TRUE;
$cats .= $virtuemart_category_id;
$where[] = ' `pc`.`virtuemart_category_id` IN ('.$cats.') ';
} else {
if(is_array($virtuemart_category_id)) {
$category_id = array_filter(array_map('intval', $virtuemart_category_id));
if(!empty($category_id))
{
$where[] = ' `pc`.`virtuemart_category_id` IN (' . implode(',', $category_id) . ')';
}
} else {
$where[] = ' `pc`.`virtuemart_category_id` = ' . $virtuemart_category_id;
}
}
This will fix the issue for the time being. A permanent solution is expected in the next release.
Thank you but this didn't solve the problem for me. Same error when filtering by category, search or when I change page.
Then you must have changed the wrong codes. Category filtering works fine now.
Modified file attached.
Thank you for the file. I uploaded the file in administrator/components/com_virtuemart/models, I cleared all browser history and cookies and I still have the same problem after the update.
Any ideas?
Thank you Jumbo !!!!!!!!!!!
...tu m'as sauvé ;)
Quote from: EsSa55 on November 25, 2020, 15:10:59 PM
Thanks, Jumbo
Products now open in the backend.
However, Product Price, image(s), Category(ies) and Manufacturer are now empty.
TIA
That's a different issue. It appears that the database was not updated correctly during the update and the data were lost.
Thank you very much that did the trick.
I'm not sure if its related but I have one more problem here that is when I click "New" on the Virtuemart product page I get a HTTP ERROR 500 after a little while.
I'm able to clone or edit though but unable to add a new product.
Hi Jumbo,
thank you very much .. now it is working.
thanks!!!!, it works!!!!!
Quote from: Jumbo! on November 25, 2020, 19:24:24 PM
Quote from: EsSa55 on November 25, 2020, 15:10:59 PM
Thanks, Jumbo
Products now open in the backend.
However, Product Price, image(s), Category(ies) and Manufacturer are now empty.
TIA
That's a different issue. It appears that the database was not updated correctly during the update and the data were lost.
The database content is correct but it is not being read.
Do you think repeating the update might solve the issue?
Thankfully, this was on a dev installation, not Live.
TIA
I have restored another Live backup into my dev installation and repeated the VM update.
The issue is the same.
There are 6740 products.
The latest 114 display correctly.
The remainder have no images, categories, manufacture, price.
The database tables are correct.
Thank you Jumbo!, your solution worked for me.
Your solution is ok!!
But now, the product order doesn't work :-(
I'll be waiting for the ultimate solution!!
Please test http://dev.virtuemart.net/attachments/1276/com_virtuemart.3.8.7.10378.zip
Quote from: Milbo on November 27, 2020, 12:14:20 PM
Please test http://dev.virtuemart.net/attachments/1276/com_virtuemart.3.8.7.10378.zip
THIS worked! THANK YOU VERY MUCH! :D
Your solution is ok but... changing the product order doesn't work!!
Do you think to develop another version??
When I wrote the fix, I did not see the version of Jumbo. My fix works completly different, because the basic construction had a big error. So the technic now is to convert it always to an array.
if (!empty($virtuemart_category_id )){
if( is_array($virtuemart_category_id)) {
$virtuemart_category_id = array_filter($virtuemart_category_id);
} else {
$virtuemart_category_id = array($virtuemart_category_id);
}
}
if (!empty($virtuemart_category_id )) {
$joinCategory = TRUE;
VmConfig::set('show_subcat_products',true);
if(VmConfig::get('show_subcat_products',false)){
/*GJC add subcat products*/
$catmodel = VmModel::getModel ('category');
$cats = '';
foreach($virtuemart_category_id as $catId){
$childcats = $catmodel->getChildCategoryList(1, $catId,null, null, true);
foreach($childcats as $k=>$childcat){
if(!empty($childcat->virtuemart_category_id)){
$cats .= $childcat->virtuemart_category_id .',';
}
}
$cats .= $catId;
}
if(!empty($cats)){
$joinCategory = TRUE;
$where[] = ' `pc`.`virtuemart_category_id` IN ('.$cats.') ';
}
} else {
$where[] = ' `pc`.`virtuemart_category_id` IN ('.implode(',',$virtuemart_category_id).') ';
}
} else if ($isSite) {
if (!VmConfig::get('show_uncat_parent_products',TRUE)) {
$joinCategory = TRUE;
$where[] = ' ((p.`product_parent_id` = "0" AND `pc`.`virtuemart_category_id` > "0") OR p.`product_parent_id` > "0") ';
}
if (!VmConfig::get('show_uncat_child_products',TRUE)) {
$joinCategory = TRUE;
$where[] = ' ((p.`product_parent_id` > "0" AND `pc`.`virtuemart_category_id` > "0") OR p.`product_parent_id` = "0") ';
}
}
It replaces more than Jumbos code suggestion.
Excuse me,
Should I replace the code from your last update "virtuemart.3.8.7.10378.zip" with this one?
Which are the the row numbers?? With this patch, does it work the change of product order of a category in the frontend?
Thank you very much
the idea is to install (carefully .. i.e. on clone etc first ) virtuemart.3.8.7.10378.zip
I am getting this error too. When I tried to add some categories and products, I get it not when the created the category but when I went to create the products. (See screenshot)
I really need to get this fixed so if anyone has a solution for me I would really appreciate it.
Thanks Annie
Joomla 3.9
Virtuemart 3.4
PHP Version 7.4.13
www.puppylanetreats.com.au
This is because JOOMLA or PHP changed. Can You downgrade Your PHP perhaps ?
Jörgen @ Kreativ Fotografi
Quote from: Milbo on November 27, 2020, 12:14:20 PM
Please test http://dev.virtuemart.net/attachments/1276/com_virtuemart.3.8.7.10378.zip
Took quite some time to find this fix!
This error gives a LOT of results when searching: 1054 Unknown column 'Array' in 'where clause
Quote from: ruleragency on November 25, 2020, 16:25:37 PM
Quote from: Jumbo! on November 25, 2020, 15:07:34 PM
Quote from: ruleragency on November 25, 2020, 15:00:57 PM
Quote from: Jumbo! on November 25, 2020, 14:28:44 PM
Open - administrator/components/com_virtuemart/models/product.php
Find the exact following codes between lines 473 to 479:
if(!empty($cats)){
$joinCategory = TRUE;
$cats .= $virtuemart_category_id;
$where[] = ' `pc`.`virtuemart_category_id` IN ('.$cats.') ';
} else {
$where[] = ' `pc`.`virtuemart_category_id` = ' . $virtuemart_category_id;
}
Replace above by:
if(!empty($cats)) {
$joinCategory = TRUE;
$cats .= $virtuemart_category_id;
$where[] = ' `pc`.`virtuemart_category_id` IN ('.$cats.') ';
} else {
if(is_array($virtuemart_category_id)) {
$category_id = array_filter(array_map('intval', $virtuemart_category_id));
if(!empty($category_id))
{
$where[] = ' `pc`.`virtuemart_category_id` IN (' . implode(',', $category_id) . ')';
}
} else {
$where[] = ' `pc`.`virtuemart_category_id` = ' . $virtuemart_category_id;
}
}
This will fix the issue for the time being. A permanent solution is expected in the next release.
Thank you but this didn't solve the problem for me. Same error when filtering by category, search or when I change page.
Then you must have changed the wrong codes. Category filtering works fine now.
Modified file attached.
Thank you for the file. I uploaded the file in administrator/components/com_virtuemart/models, I cleared all browser history and cookies and I still have the same problem after the update.
Any ideas?
It works perfectly for me too. My eshop operates with the template virtueplanet.com/joomla-templates/vp-smart (https://www.virtueplanet.com/joomla-templates/vp-smart) in Joomla! 3.9.23, VirtueMart 3.8.6 10373 & PHP Version 7.4.13.
Thank you very much!