Call to a member function getName() on null: Problem with Hikashop and Quix

  • Posts: 20
  • Thank you received: 5
5 years 1 month ago #312450

-- url of the page with the problem -- : Not live
-- HikaShop version -- : 4.2.2
-- Joomla version -- : 3.9.12
-- PHP version -- : 7.3.10
-- Browser(s) name and version -- : Firefox Mac 70.0b3
-- Error-message(debug-mod must be tuned on) -- : Call to a member function getName() on null
/home4/x110com/public_html/toddsbettersnacks/administrator/components/com_hikashop/helpers/helper.php:771
Call stack
# Function Location
1 () JROOT/administrator/components/com_hikashop/helpers/helper.php:771
2 hikashop_getLayout() JROOT/modules/mod_hikashop_cart/mod_hikashop_cart.php:67
3 include() JROOT/plugins/system/t3/includes/joomla4/ModuleHelper.php:201
4 Joomla\CMS\Helper\ModuleHelper::renderModule() JROOT/libraries/src/Document/Renderer/Html/ModuleRenderer.php:98
5 Joomla\CMS\Document\Renderer\Html\ModuleRenderer->render() JROOT/libraries/src/Document/Renderer/Html/ModulesRenderer.php:47
6 Joomla\CMS\Document\Renderer\Html\ModulesRenderer->render() JROOT/libraries/src/Document/HtmlDocument.php:491
7 Joomla\CMS\Document\HtmlDocument->getBuffer() JROOT/libraries/src/Document/HtmlDocument.php:783
8 Joomla\CMS\Document\HtmlDocument->_renderTemplate() JROOT/libraries/src/Document/HtmlDocument.php:557
9 Joomla\CMS\Document\HtmlDocument->render() JROOT/libraries/src/Application/CMSApplication.php:1044
10 Joomla\CMS\Application\CMSApplication->render() JROOT/libraries/src/Application/SiteApplication.php:778
11 Joomla\CMS\Application\SiteApplication->render() JROOT/libraries/src/Application/CMSApplication.php:202
12 Joomla\CMS\Application\CMSApplication->execute() JROOT/index.php:49

I'm reporting a problem I fixed.
I'm running Hikashop on T3 framework and Quix page builder.
The problem was only appearing on my home page, and for some reason having "quix" as the viewtype was causing the error.

I had to add the following code before line 769 in /administrator/components/com_hikashop/helpers/helper.php :
if(($viewType=='quix')) $viewType = 'html';

I hope this helps someone and that a fix can get applied to Hikashop.

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

  • Posts: 82867
  • Thank you received: 13374
  • MODERATOR
5 years 1 month ago #312458

Hi,

Thank you for your feedback.
What we'll do is change the line:
if(empty($viewType)) $viewType = 'html';
to:
if(empty($viewType) || !in_arra($viewType, array('html', 'feed'))) $viewType = 'html';
in that same hikashop_getLayout() function so that it's not possible to load view types that we don't support. That will avoid such errors in the future.

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

  • Posts: 20
  • Thank you received: 5
5 years 1 month ago #312492

Sounds great, thanks.

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

Time to create page: 0.034 seconds
Powered by Kunena Forum