CMS MADE SIMPLE FORGE

Products

 

[#11668] Fatal error Product module on re-index core Search module

avatar
Created By: Rolf (rolf1)
Date Submitted: Tue Dec 12 09:15:19 -0500 2017

Assigned To: Robert Campbell (calguy1000)
Version: 2.28.3
CMSMS Version: 2.2.4
Severity: None
Resolution: Fixed
State: Open
Summary:
Fatal error Product module on re-index core Search module
Detailed Description:
Hi Robert,

I reproduced this also on a new install at my dev-server with PHP 7.0.26

Simple click re-index all content in the core search module and it breaks at:

Fatal error: Uncaught Error: Call to a member function get_extra() on array in
/home/x/public_html/x.com/modules/Products/functions.admin_tools.php:48 Stack
trace: #0 /home/x/public_html/x.com/modules/Products/Products.module.php(380):
products_SearchReindex(Object(Products), Object(Search)) #1
/home/x/public_html/x.com/modules/Search/search.tools.php(191):
Products->SearchReindex(Object(Search)) #2
/home/x/public_html/x.com/modules/Search/Search.module.php(190):
search_Reindex(Object(Search)) #3
/home/x/public_html/x.com/modules/Search/action.defaultadmin.php(6):
Search->Reindex() #4
/home/x/public_html/x.com/lib/classes/class.CMSModule.php(1415):
include('/home/x/...') #5
/home/x/public_html/x.com/lib/classes/class.CMSModule.php(1489):
CMSModule->DoAction('defaultadmin', 'm1_', Array, '') #6
/home/x/public_html/x.com in
/home/x/public_html/x.com/modules/Products/functions.admin_tools.php on line 48

Thank you,

Rolf


History

Comments
avatar
Date: 2017-12-17 12:55
Posted By: Rolf (rolf1)

reproduced on new install CMSMS 2.2.5 alpha on PHP 7.1.1.
just install the module and add 1 product item.
I have debug true / error displaying enabled
click reindex all content in core search module
      
avatar
Date: 2018-01-21 12:33
Posted By: Robert Campbell (calguy1000)

fixed in svn.
      
avatar
Date: 2018-03-30 03:59
Posted By: Rolf (rolf1)

Thanks for the new release, Robert!
Just tested this report, but it is not fixed for me. I get the same (only other
line) when reindexing the content in the core Search module

Fatal error: Uncaught Error: Cannot use object of type Products\Product as array
in /home/.../public_html/modules/Products/functions.admin_tools.php:50 Stack
trace: #0 /home/.../public_html/modules/Products/Products.module.php(380):
products_SearchReindex(Object(Products), Object(Search)) #1
/home//public_html/modules/Search/search.tools.php(191):
Products->SearchReindex(Object(Search)) #2
/home/.../public_html/modules/Search/Search.module.php(190):
search_Reindex(Object(Search)) #3
/home/.../public_html/modules/Search/action.defaultadmin.php(6):
Search->Reindex() #4
/home/.../public_html/lib/classes/class.CMSModule.php(1406):
include('/home/.../pu...') #5
/home/.../public_html/lib/classes/class.CMSModule.php(1480):
CMSModule->DoAction('defaultadmin', 'm1_', Array, '') #6
/home/.../public_html/admin/moduleinterface.php(74):
CMSModule->DoActionBase('defaultadmin', 'm1_', Array, '', Object(Smarty_CMS)) #7
{main} thrown in
/home/.../public_html/modules/Products/functions.admin_tools.php on line 50

CMSMS core 2.2.7
Products 2.28.4 (all the rest the latest available)
PHP 7.0.28

Grtz. Rolf
      
avatar
Date: 2018-07-31 06:51
Posted By: Guido Goluke (Luke82)

I can confirm this is not fixed:

Fatal error: Cannot use object of type Products\Product as array in
/public_html/websitedev/modules/Products/functions.admin_tools.php on line 50
      
avatar
Date: 2018-07-31 08:57
Posted By: Guido Goluke (Luke82)

The reason behind this is line 50 in that file states

if( is_array($words) && count($words) )
$module->AddWords($mod->GetName(),$tmp['id'],'product',implode(' ',$words));

But $tmp is not an array, it is an instance of Products, so it should be

if( is_array($words) && count($words) )
$module->AddWords($mod->GetName(),$tmp->id,'product',implode(' ',$words));

Notice that $tmp is now treated as an object.
      
avatar
Date: 2018-07-31 11:26
Posted By: Robert Campbell (calguy1000)

Fixed again in svn
      
Updates

Updated: 2018-01-21 12:33
resolution_id: => 7