Error in category view after upgrading to 2.3.5

  • Posts: 6
  • Thank you received: 0
10 years 3 months ago #187199

-- HikaShop version -- : 2.3.5
-- Joomla version -- : 3.3.6
-- PHP version -- : 5.3

Hello,

After upgrading Hikashop from 2.3.3 to 2.3.5 (on a test-site) the category view and the product view gives the error:
Fatal error: Call to undefined method RuntimeException::get() in /..../libraries/legacy/error/error.php on line 533

Linking to 1 product gives no error.
I've searched the forum and via Google but do not see this message / error at after upgrading to 2.3.5

In which direction should I look for the solution

Thanks

Last edit: 10 years 3 months ago by Kees.

Please Log in or Create an account to join the conversation.

  • Posts: 26223
  • Thank you received: 4035
  • MODERATOR
10 years 3 months ago #187218

Hi,

The fatal error you got is not coming from HikaShop but from Joomla.
It will be interesting to got the call stack to know why the Joomla error system is called.
But about the fatal error ; it's not HikaShop.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 193
  • Thank you received: 76
10 years 3 months ago #187239

1. Append ?template=protostar to url of page giving this error and try to open it. (e.g. yoursite.com/category?template=protostar )
I saw similar error coming from error.php of custom template.

2. If your test site is on localhost, enable xDebug and you will get better error messages with call stack.

3. In the file libraries/legacy/error/error.php add following code right above line 533

echo '<pre>';var_dump( debug_backtrace());die();

This will print call stack and you will be able to find out where this error is coming from.
Don't forget to remove this code when you are done.

The following user(s) said Thank You: Jerome

Please Log in or Create an account to join the conversation.

  • Posts: 6
  • Thank you received: 0
10 years 3 months ago #187256

Hello

@Jerome
The entire site is continuing well (with forum, events etc). Only the link to the HikaShop category view gives the error

@Korzo
The link to the category view is
.../com_hikashop & view = category & layout = Listing & Itemid = 153
If I put it the Itemid on152, I get the correct categories...
(.../com_hikashop & view = category & layout = Listing & Itemid = 152)
If I choose one of the categories I get the same error message again

I have
echo '<pre>'; var_dump (debug_backtrace ()); that ();
placed in the code as suggested and a part of the call stack:

array(2) {
[0]=>
& Object (RuntimeException) # 690 (7) {
["message": protected] =>
string (301) "Unknown column 'a.product_name' in 'order clause' SQL = SELECT DISTINCT b. * FROM test_hikashop_product_category AS a LEFT JOIN test_hikashop_product AS b ON a.product_id = b.product_id WHERE b.product_published = 1 AND b. product_type = 'main' AND a.category_id IN (2) ORDER BY a.product_name ASC LIMIT 0, 20 '

I hope you can help me further with this information.

Thanks!

Please Log in or Create an account to join the conversation.

  • Posts: 193
  • Thank you received: 76
10 years 3 months ago #187265

Could you copy/paste whole output?

Also try this URL: index.php?option=com_hikashop&view=category&layout=listing&Itemid=153&template=protostar

Please Log in or Create an account to join the conversation.

  • Posts: 6
  • Thank you received: 0
10 years 3 months ago #187270

Hi

I had already changed the template but this has no effect (the error persists)

The entire output is more than 2000 lines....The main error-message is:

1054 - Unknown column 'a.product_name' in 'order clause' SQL=SELECT DISTINCT b.* FROM test_hikashop_product_category AS a LEFT JOIN test_hikashop_product AS b ON a.product_id=b.product_id WHERE b.product_published=1 AND b.product_type = 'main' AND a.category_id IN (17) ORDER BY a.product_name ASC LIMIT 0, 20

Today I will make a full backup of the production site and perform the upgrade again.
Further help is welcome
Thanks

Please Log in or Create an account to join the conversation.

  • Posts: 20
  • Thank you received: 1
  • Hikashop Business
10 years 3 months ago #187283

Hi I have the same error after upgrading to 2.3.5 business
Joomla 2.5.28
PHP 5.4.36

Error: 500 - JDatabaseMySQL::query: 1054 - Unknown column 'a.product_name' in 'order clause' SQL=SELECT DISTINCT b.* FROM hzlt_hikashop_product_category AS a LEFT JOIN hzlt_hikashop_product AS b ON a.product_id=b.product_id WHERE b.product_published=1 AND b.product_type = 'main' AND a.category_id IN (16) AND (b.product_access = 'all' OR b.product_access LIKE '%,1,%') ORDER BY a.product_name ASC LIMIT 0, 40

Again, any ideas?

Please Log in or Create an account to join the conversation.

  • Posts: 26223
  • Thank you received: 4035
  • MODERATOR
10 years 3 months ago #187297

Hi,

Please edit the file "components/com_hikashop/views/product/view.html.php" and replace

		if(empty($defaultParams['add_to_wishlist']))
			$defaultParams['add_to_wishlist'] = 0;

		if($this->params->get('product_order', 'ordering') == 'ordering')
			$table = 'a';
By
		if(empty($defaultParams['add_to_wishlist']))
			$defaultParams['add_to_wishlist'] = 0;

And also
		if($this->params->get('show_quantity_field', '0') == '1')
			$this->params->set('show_quantity_field', 1);
		if((int)$this->params->get('limit') == 0)
			$this->params->set('limit', 1);
By
		if($this->params->get('show_quantity_field', '0') == '1')
			$this->params->set('show_quantity_field', 1);
		if((int)$this->params->get('limit') == 0)
			$this->params->set('limit', 1);

		if($this->params->get('product_order', 'ordering') == 'ordering')
			$table = 'a';
It will fix the SQL error while using a product listing module without any configuration.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
The following user(s) said Thank You: speru

Please Log in or Create an account to join the conversation.

  • Posts: 6
  • Thank you received: 0
10 years 3 months ago #187314

Hello Jerome

That works, thanks!

what do you mean with:

while using a product listing module without any configuration.


For the production site, I'll wait until version 2.3.6 or did you make the adjustment in the current package?

Thanks for the quick fix!

Please Log in or Create an account to join the conversation.

  • Posts: 26223
  • Thank you received: 4035
  • MODERATOR
10 years 3 months ago #187318

Hi,

For the moment the best is to patch the website.
I don't have the possibility to update the HikaShop 2.3.5 package for the moment ; I'll see with Nicolas if we patch the package or if we release a 2.3.6 sooner.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

Time to create page: 0.093 seconds
Powered by Kunena Forum