- Posts: 107
- Thank you received: 1
Problem with the filters
13 years 2 months ago - 13 years 2 months ago #123597
by Ronon
Problem with the filters was created by Ronon
-- url of the page with the problem -- :
www.tengoqueprobarlo.com/aceites/aceites-comestibles
-- HikaShop version -- : 2.2.1
-- Joomla version -- : 2.5.14
-- PHP version -- : 5.2.17
-- Browser(s) name and version -- : Google Chrome 29
-- Error-message(debug-mod must be tuned on) -- : "Error cargando Módulo MySQL server has gone away SQL=SELECT m.id, m.title, m.module, m.position, m.content, m.showtitle, m.params, mm.menuid FROM wn6ki_modules AS m LEFT JOIN wn6ki_modules_menu AS mm ON mm.moduleid = m.id LEFT JOIN wn6ki_extensions AS e ON e.element = m.module AND e.client_id = m.client_id WHERE m.published = 1 AND e.enabled = 1 AND (m.publish_up = '0000-00-00 00:00:00' OR m.publish_up <= '2013-09-14 18:34:41') AND (m.publish_down = '0000-00-00 00:00:00' OR m.publish_down >= '2013-09-14 18:34:41') AND m.access IN (1,1) AND m.client_id = 0 AND (mm.menuid = 690 OR mm.menuid <= 0) ORDER BY m.position, m.ordering
Warning: Invalid argument supplied for foreach() in /homez.714/tengoque/www/administrator/components/com_hikashop/classes/currency.php on line 1355
"
Hi, I have a problem with the filters in my shop. When I apply any of them, you see the error you see in the image attached. I have filters that are configured to sort by price, manufacturer, search, etc..
What could be wrong? Thank you.
Editting: The file "currrency.php" I have attached to this post. The code appears that fails is this:
Line number 1355 is this:
foreach($results as $k => $v){
-- HikaShop version -- : 2.2.1
-- Joomla version -- : 2.5.14
-- PHP version -- : 5.2.17
-- Browser(s) name and version -- : Google Chrome 29
-- Error-message(debug-mod must be tuned on) -- : "Error cargando Módulo MySQL server has gone away SQL=SELECT m.id, m.title, m.module, m.position, m.content, m.showtitle, m.params, mm.menuid FROM wn6ki_modules AS m LEFT JOIN wn6ki_modules_menu AS mm ON mm.moduleid = m.id LEFT JOIN wn6ki_extensions AS e ON e.element = m.module AND e.client_id = m.client_id WHERE m.published = 1 AND e.enabled = 1 AND (m.publish_up = '0000-00-00 00:00:00' OR m.publish_up <= '2013-09-14 18:34:41') AND (m.publish_down = '0000-00-00 00:00:00' OR m.publish_down >= '2013-09-14 18:34:41') AND m.access IN (1,1) AND m.client_id = 0 AND (mm.menuid = 690 OR mm.menuid <= 0) ORDER BY m.position, m.ordering
Warning: Invalid argument supplied for foreach() in /homez.714/tengoque/www/administrator/components/com_hikashop/classes/currency.php on line 1355
"
Hi, I have a problem with the filters in my shop. When I apply any of them, you see the error you see in the image attached. I have filters that are configured to sort by price, manufacturer, search, etc..
What could be wrong? Thank you.
Editting: The file "currrency.php" I have attached to this post. The code appears that fails is this:
This attachment is hidden for guests.
Please log in or register to see it.
Please log in or register to see it.
Code:
function getCurrencies($ids,&$currencies){
static $cachedCurrencies=array();
if(!empty($currencies)){
foreach($currencies as $currency){
$this->checkLocale($currency);
$cachedCurrencies[(int)$currency->currency_id]=$currency;
}
}
if(!is_null($ids)){
if(!is_array($ids)){
$ids = array($ids);
}
$need = array();
foreach($ids as $id){
if(!isset($cachedCurrencies[(int)$id])){
$need[]=(int)$id;
}
}
if(!empty($need)){
$query = 'SELECT * FROM '.hikashop_table('currency').' WHERE currency_id IN ('.implode(',',$need).')';
$this->database->setQuery($query);
$results = $this->database->loadObjectList();
foreach($results as $k => $v){
$this->checkLocale($results[$k]);
}
$this->getCurrencies(null,$results);
}
$found = array();
foreach($ids as $id){
if(isset($cachedCurrencies[(int)$id])) $found[(int)$id]=$cachedCurrencies[(int)$id];
}
return $found;
}
return true;
}
Line number 1355 is this:
foreach($results as $k => $v){
Last edit: 13 years 2 months ago by Ronon.
Please Log in or Create an account to join the conversation.
13 years 2 months ago #123836
by Xavier
Replied by Xavier on topic Problem with the filters
Hi,
Thanks to try to add the code:
Before the foreach.
Thanks to try to add the code:
Code:
if(empty($results) || is_null($results)) $results = array();
Please Log in or Create an account to join the conversation.
13 years 2 months ago - 13 years 2 months ago #123842
by Ronon
Replied by Ronon on topic Problem with the filters
Hi, I wrote this:
And then I uploaded to FTP. I've tried using the filter to sort the products by price, and I get this other error:
Error cargando Módulo MySQL server has gone away SQL=SELECT m.id, m.title, m.module, m.position, m.content, m.showtitle, m.params, mm.menuid FROM wn6ki_modules AS m LEFT JOIN wn6ki_modules_menu AS mm ON mm.moduleid = m.id LEFT JOIN wn6ki_extensions AS e ON e.element = m.module AND e.client_id = m.client_id WHERE m.published = 1 AND e.enabled = 1 AND (m.publish_up = '0000-00-00 00:00:00' OR m.publish_up <= '2013-09-16 14:54:36') AND (m.publish_down = '0000-00-00 00:00:00' OR m.publish_down >= '2013-09-16 14:54:36') AND m.access IN (1,1) AND m.client_id = 0 AND (mm.menuid = 751 OR mm.menuid <= 0) ORDER BY m.position, m.ordering
Warning: mysql_query() [function.mysql-query]: Unable to save result set in /homez.714/tengoque/www/libraries/joomla/database/database/mysql.php on line 534
Still fails... Thanks for your help
Edit: Attached the file "mysql.php"
Code:
if(empty($results) || is_null($results)) $results = array();
foreach($results as $k => $v){
$this->checkLocale($results[$k]);
}
And then I uploaded to FTP. I've tried using the filter to sort the products by price, and I get this other error:
Error cargando Módulo MySQL server has gone away SQL=SELECT m.id, m.title, m.module, m.position, m.content, m.showtitle, m.params, mm.menuid FROM wn6ki_modules AS m LEFT JOIN wn6ki_modules_menu AS mm ON mm.moduleid = m.id LEFT JOIN wn6ki_extensions AS e ON e.element = m.module AND e.client_id = m.client_id WHERE m.published = 1 AND e.enabled = 1 AND (m.publish_up = '0000-00-00 00:00:00' OR m.publish_up <= '2013-09-16 14:54:36') AND (m.publish_down = '0000-00-00 00:00:00' OR m.publish_down >= '2013-09-16 14:54:36') AND m.access IN (1,1) AND m.client_id = 0 AND (mm.menuid = 751 OR mm.menuid <= 0) ORDER BY m.position, m.ordering
Warning: mysql_query() [function.mysql-query]: Unable to save result set in /homez.714/tengoque/www/libraries/joomla/database/database/mysql.php on line 534
Still fails... Thanks for your help
Edit: Attached the file "mysql.php"
Last edit: 13 years 2 months ago by Ronon.
Please Log in or Create an account to join the conversation.
13 years 2 months ago #123920
by Xavier
Replied by Xavier on topic Problem with the filters
Hi,
Have you this error only after filtering by price ?
Or it's displayed anytime ? If you go to the same page without filtering, is this error displayed ?
I ask that because it don't seem to be related on HikaShop, but to the joomla modules.
Have you this error only after filtering by price ?
Or it's displayed anytime ? If you go to the same page without filtering, is this error displayed ?
I ask that because it don't seem to be related on HikaShop, but to the joomla modules.
Please Log in or Create an account to join the conversation.
13 years 2 months ago #123939
by Ronon
Replied by Ronon on topic Problem with the filters
Hello, the products look good on any menu in which between. Also I browse well for them and the buying process is correct. The problem is only in the filter sorting by price.
When I apply a filter Price (sort by price up or down) you get the error.
However, these filters work perfectly normally: sort by price range (from 50 to 100 € for example, with a combo box), sort by price range (with a slider) sort by name (up or down), filtering by manufacturer name and search by text.
Now all filters work well, do not know if you can be my server failure or what because now go well. Normally the only filter that fails is to sort by price, but now also works well. Yesterday was impossible! Could it be a fault of my hosting?
Thank you very much for your help.
When I apply a filter Price (sort by price up or down) you get the error.
However, these filters work perfectly normally: sort by price range (from 50 to 100 € for example, with a combo box), sort by price range (with a slider) sort by name (up or down), filtering by manufacturer name and search by text.
Now all filters work well, do not know if you can be my server failure or what because now go well. Normally the only filter that fails is to sort by price, but now also works well. Yesterday was impossible! Could it be a fault of my hosting?
Thank you very much for your help.
Please Log in or Create an account to join the conversation.
13 years 2 months ago #123996
by Xavier
Replied by Xavier on topic Problem with the filters
It was maybe a problem due to a wrong parameter in session, or something like that.
Please Log in or Create an account to join the conversation.
13 years 1 month ago #124299
by Ronon
Replied by Ronon on topic Problem with the filters
It may be a matter of my hosting because it also is giving me SQL errors J4age component for site statistics, which had never failed me ...
VPS Server I am looking to see how, with shared hosting because I'm not happy, gives many faults and is very slow.
Greetings.
VPS Server I am looking to see how, with shared hosting because I'm not happy, gives many faults and is very slow.
Greetings.
Please Log in or Create an account to join the conversation.
Time to create page: 0.077 seconds