HikaShop Smart Search plugin causes PHP warnings in Finder\Result.php after Nove

  • Posts: 620
  • Thank you received: 23
  • Hikaserial Subscription Hikashop Multisite
15 hours 3 minutes ago #369215

-- HikaShop version -- : 6.1.0 (old and new)
-- Joomla version -- : 5.4.0
-- PHP version -- : 8.3

Hi HikaShop team,

After updating from the September 4th build of HikaShop 6.1.0 to the November 3rd build of the same version, I started getting multiple PHP warnings on all Joomla Smart Search (com_finder) pages.

The warnings are:

Warning: Undefined property: stdClass::$id in /administrator/components/com_finder/src/Indexer/Result.php on line 576
Warning: Attempt to read property "state" on array in /administrator/components/com_finder/src/Indexer/Result.php on line 577
Warning: Attempt to read property "access" on array in /administrator/components/com_finder/src/Indexer/Result.php on line 578


What I found:

The issue appears only when the HikaShop Products Smart Search plugin is enabled.

When I disable that plugin and rebuild the index, the warnings disappear.

When I re-enable it and rebuild the index again, the warnings return immediately.

The rest of the Finder plugins (Content, Tags, etc.) work fine.

This behavior is reproducible on multiple websites after updating to the 6.1.0 (November 3) release.



Steps to reproduce:

Update HikaShop 6.1.0 (September 4 build) → 6.1.0 (November 3 build)

Go to Components → Smart Search → Index → Rebuild

Perform a frontend search (via com_finder or YOOtheme integration)
→ PHP warnings appear in Finder\Result.php

Temporary workaround:
Disabling the plugin and rebuilding the index eliminates the issue.
It seems the plugin returns an array instead of an object during indexing.

Hope you can fix this issue.

Thanks in advance for your help,
Lumiga


Kind regards,
Lumiga
Attachments:
Last edit: 13 hours 40 minutes ago by Lumiga.

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

  • Posts: 84623
  • Thank you received: 13759
  • MODERATOR
10 hours 31 minutes ago #369216

Hi,

Thanks for the feedback. While I was able to reproduce the issue on my end, it didn't came from something changed in HikaShop 6.1.0. I was even able to reproduce the warning with previous versions of HikaShop and we didn't change anything related to the Smart search (finder) since almost 6 months ago.

From what I could see, it comes from several things together :
- the error reporting displaying warnings on your website. This should not be the case on live websites, for security reasons
- the lack of checks when unserializing taxonomies in the finder component's helper result file during the display of results on the frontend
- the finder component only storing taxonomy nodes for the last element of the branch array instead of doing it for all of them, resulting in missing node ids during the indexing
- the finder plugin in HikaShop not properly reseting the taxonomies array when indexing the elements because of a lack of that capability provided by the joomla finder component's helper while handling multilingual capabilities
I think it might also be linked to changed in Joomla 5.4 / 6.0 with the finder component since this was not a problem before

I was able to circumvent the issue by reseting the taxonomies in a crude way during the indexing so as the finder component can do its work without unexpected data. I've added the patch on our end. Download the install package of the 6.1.0 on our website and install it on yours to get the patch. You'll have to reindex the content so that the plugin can provide data to the finder component without unexpected data.

Last edit: 13 hours 30 minutes ago by nicolas.

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

Time to create page: 0.061 seconds
Powered by Kunena Forum