Category Listings Menu item is empty after Joomla 3.8.9/.10 upgrade

  • Posts: 175
  • Thank you received: 14
  • Hikashop Business
3 months 3 weeks ago #294468

-- HikaShop version -- : 3.4.0
-- Joomla version -- : 3.8.9
-- PHP version -- : 5.6.36
-- Browser(s) name and version -- : any
-- Error-message(debug-mod must be tuned on) -- : None

Working fine before Joomla 3.8.9 security update and for years before that.

It will show sub-categories and the category description.
But no products are showing.

No other changes other than this 3.8.9 upgrade.

Edit - I upgraded to Joomla 3.8.10 release, same issue = no products showing in Categories (menu or otherwise).

I cannot find any web error logs or debug entries.
I also replicated this on on our internal test site by just upgrading to 3.8.9.

SEF options don't seem to matter.

Product Listings menu item works fine however, so specific to Category Listings.

Last Edit: 3 months 3 weeks ago by jazzmang. Reason: More information.

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

  • Posts: 22884
  • Thank you received: 3551
  • MODERATOR
3 months 3 weeks ago #294471

Hello,

Step 1 - Please edit "components/com_hikashop/views/category/tmpl/listing.php" and replace

	$data = $this->params->get('data');
	if(isset($data->hk_product) && is_object($data->hk_product)) {
By
	$data = $this->params->get('data');
	if(empty($data)) {
		$hk_p = $this->params->get('hk_product');
		if(!empty($hk_p)) {
			$data = new stdClass();
			$data->hk_product = $hk_p;
		}
	}
	if(isset($data->hk_product) && (is_object($data->hk_product) || is_array($data->hk_product))) {
Important note : If you do have a template view override for "category / listing", you will have to apply that patch into the override.
www.hikashop.com/support/documentation/1...-display.html#layout

Step 2 - Edit the file "administrator/components/com_hikashop/helpers/module.php" and replace
	if(isset($data->$type) && is_object($data->$type)) {
		foreach($data->$type as $k => $v) {
			$obj->params->set($k,$v);
		}
	}
By
	if(isset($data->$type) && is_object($data->$type)) {
		foreach($data->$type as $k => $v) {
			$obj->params->set($k,$v);
		}
	} else {
		$data = $obj->params->get('hk_'.$obj->ctrl);
		if(!empty($data) && is_array($data)) {
			foreach($data as $k => $v) {
				$obj->params->set($k,$v);
			}
		}
	}

Step 3 - Edit the file "components/com_hikashop/views/product/view.html.php" and replace
	$data = $this->params->get('data',new stdClass());
By
	$data = $this->params->get('data', false);
	if($data === false) {
		$data = new stdClass();
		$data->hk_product = $this->params->get('hk_product', false);
		if(!empty($data->hk_product))
			$data->hk_product = (object)$data->hk_product;
	}

Step 4 - Finally edit the file "components/com_hikashop/views/category/view.html.php" and replace
	$data = $this->params->get('data',new stdClass());
By
	$data = $this->params->get('data', false);
	if($data === false) {
		$data = new stdClass();
		$data->hk_category = $this->params->get('hk_category', false);
		if(!empty($data->hk_category))
			$data->hk_category = (object)$data->hk_category;
	}

And it will fix the issue the Joomla 3.8.9 (and 3.8.10) just introduced.

We will review the code and include it as hotpatch in HikaShop 3.4.0 as soon as possible.
Additional note : The patches have been added into HikaShop 3.4.1 release.
www.hikashop.com/support/documentation/5...ashop-changelog.html

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.
Last Edit: 3 months 3 weeks ago by Jerome. Reason: Additional note for "category / listing" overrides
The following user(s) said Thank You: jazzmang, brianbt, WJ, CDULAC, shamid1369

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

  • Posts: 26
  • Thank you received: 2
  • Hikaserial Standard Hikashop Business
3 months 3 weeks ago #294472

I have encountered this as well, although the initial problem was worse that it only showed the top category this cleared when I changed "Force canonical URLs on listings" from "Use Canocial URL if Specified" to "No Generate the URLS"

Interestingly I have a separate site with only a fresh Joomla install & Hikashop installed and this isn't showing any problems.

The hotpatch and changing the SEF option in the configuration is in the right direction although not a perfect solution.

Last Edit: 3 months 3 weeks ago by Twincarb.

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

  • Posts: 175
  • Thank you received: 14
  • Hikashop Business
3 months 3 weeks ago #294473

The hot-fix helps withe categories that have products showing but found it doesn't fix category listings that just show sub-categories.

While not blank, it just shows the default top level catalog category listing - rendering the useless as any of the category links then just take you back to that same view despite the URL changing.

i.e. www.classicbilliards.net/antique-parts-accessories.html

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

  • Posts: 22884
  • Thank you received: 3551
  • MODERATOR
3 months 3 weeks ago #294474

Hello,

Please check the second fix that I just added in my first answer.

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: 175
  • Thank you received: 14
  • Hikashop Business
3 months 3 weeks ago #294476

Applied the 2nd part, and while it cleaned up some of the formatting it didn't fix the problem.

Sub-categories still just show the top-level categories again.

Even turning the "Force canonical URLs on listings" to "No Generate the URLS" really doesn't address the issue.

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

  • Posts: 40
  • Thank you received: 3
  • Hikashop Business
3 months 3 weeks ago #294478

The second fix doesn't work here neither, are the last to brackets in the last 'before the fix' correct, Jerome?

Last Edit: 3 months 3 weeks ago by WJ.

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

  • Posts: 22884
  • Thank you received: 3551
  • MODERATOR
3 months 3 weeks ago #294479

Hi,

The source of the issue is that Joomla 3.8.9 change a core element and with that major modification in the core HikaShop cannot access anymore to the "params" full data.
So in some specific cases, the parameters are not available and the hot patches are there to unsure a second way to read it while stilling keeping the retro-compatibility with Joomla 2.5.
(two more patches have been added)

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.
Last Edit: 3 months 3 weeks ago by Jerome. Reason: typo
The following user(s) said Thank You: jazzmang

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

  • Posts: 175
  • Thank you received: 14
  • Hikashop Business
3 months 3 weeks ago #294482

From what I can test so far, the full set of 4 hot-fixes addresses the issue.

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

  • Posts: 26
  • Thank you received: 2
  • Hikaserial Standard Hikashop Business
3 months 3 weeks ago #294483

I agree with jazzmang, with my original settings and the hot-fixes its working as before. Thanks for your time Jerome.
Regards,
Dave

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

  • Posts: 40
  • Thank you received: 3
  • Hikashop Business
3 months 3 weeks ago #294484

Phew, all working fine thanks Jerome

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

  • Posts: 175
  • Thank you received: 14
  • Hikashop Business
3 months 3 weeks ago #294485

Can we expect the 3.4.0 build to be updated today?

Holding off my other sites until we can update HikaShop first as patching manually 4 hot-fixes across that many sites is going to be a pain.

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

  • Posts: 85
  • Thank you received: 2
3 months 3 weeks ago #294489

i installed the 3.4.0 but still no products showing. Please help, otherwise i will have to replace backup

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

  • Posts: 26
  • Thank you received: 2
  • Hikaserial Standard Hikashop Business
3 months 3 weeks ago #294491

Have you followed the instructions in the 2nd post on this thread?
You need to replace whats referenced in the 4 files.

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

  • Posts: 85
  • Thank you received: 2
3 months 3 weeks ago #294492

going to do that right now, i'd hoped theses changes were already there. Thnx i'll keep you posted

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

  • Posts: 85
  • Thank you received: 2
3 months 3 weeks ago #294493

wow ! excellent
solved the problem

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

  • Posts: 30
  • Thank you received: 0
  • Hikashop Business
3 months 3 weeks ago #294496

Already change the all step that are mentioned by Jerome.
But it still not working. It still show the empty product after the category view.

Last Edit: 3 months 3 weeks ago by alainz.

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

  • Posts: 63606
  • Thank you received: 9161
  • MODERATOR
3 months 3 weeks ago #294497

Hi,

I've tested the patches with a Joomla 3.9.10 upgrade on my end and it works fine too.
I've generated the new build with the patch in the 3.4.0 of HikaShop (next version of HikaShop is supposed to be released this week) so if you have the issue, first thing to do now is: download the install package on our website and install it on your website.

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

  • Posts: 22
  • Thank you received: 0
  • Hikashop Business
3 months 3 weeks ago #294516

Hi,

With the last buid (downloaded today at 10:00) it seems to me that the products are shown correctly in the frontend, but in the backend when i try to edit a menu item of a category listing I get the following error: "Cannot use object of type stdClass as array". And can not edit the menu item.

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

  • Posts: 63606
  • Thank you received: 9161
  • MODERATOR
3 months 3 weeks ago #294520

Hi,

We don't have that problem on our end.
Please activate the error reporting and debug mode of the Joomla configuration and try again.
Then, provide the full error message with any information on the page ( a screenshot of the whole page would be great ).

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

Time to create page: 0.156 seconds
Powered by Kunena Forum