? ? Pending

User tests: Successful: Unsuccessful:

avatar beat
beat
23 Jan 2022

Pull Request for Issue # none

Summary of Changes

Fixes Fixes Deprecated: html_entity_decode(): Passing null to parameter #1 ($string) of type string is deprecated in administrator/components/com_finder/helpers/indexer/query.php on line 733`

Testing Instructions

Code review should be enough.

Look in frontend in PHP 8.1 with all errors on and Joomla debug on, while finder is re-indexing.

Actual result BEFORE applying this Pull Request

Deprecated: html_entity_decode(): Passing null to parameter #1 ($string) of type string is deprecated in administrator/components/com_finder/helpers/indexer/query.php on line 733

Expected result AFTER applying this Pull Request

warning disappeared.

Documentation Changes Required

none.

avatar beat beat - open - 23 Jan 2022
avatar beat beat - change - 23 Jan 2022
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 23 Jan 2022
Category Administration com_finder
avatar alikon
alikon - comment - 23 Jan 2022

I have tested this item successfully on 834b5af


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/36796.

avatar alikon alikon - test_item - 23 Jan 2022 - Tested successfully
avatar zero-24
zero-24 - comment - 23 Jan 2022

Look in frontend in PHP 8.1 with all errors on and Joomla debug on, while finder is re-indexing.

Do you have a stack trace here so we know where the "null" value is comming from? As the signature clearly says "The query input string."

And can you tell me what re-indexing you mean and how to trigger that in the frontend? Isnt indexing triggerd by the backend? Maybe I'm missing something here?

avatar beat
beat - comment - 23 Jan 2022

Look in frontend in PHP 8.1 with all errors on and Joomla debug on, while finder is re-indexing.

Do you have a stack trace here so we know where the "null" value is comming from? As the signature clearly says "The query input string."

Hi @zero-24,
Sure!

Call Stack

1 | 0.0001 | 364872 | {main}(  ) | .../index.php:0
2 | 0.0150 | 938704 | Joomla\CMS\Application\CMSApplication->execute(  ) | .../index.php:49
3 | 0.1223 | 3580104 | Joomla\CMS\Application\SiteApplication->render(  ) | .../CMSApplication.php:231
4 | 0.1224 | 3580208 | Joomla\CMS\Application\CMSApplication->render(  ) | .../SiteApplication.php:778
5 | 0.1275 | 3640504 | Joomla\CMS\Document\HtmlDocument->render( $caching = FALSE, $params = ['template'  => 'protostar', 'file' => 'index.php', 'params' => class  Joomla\Registry\Registry { protected $data = class stdClass { ... };  protected $initialized = TRUE; public $separator = '.' }, 'directory'  => '/home/beat/www/j/templates'] ) | .../CMSApplication.php:1140
6 | 0.1275 | 3640504 | Joomla\CMS\Document\HtmlDocument->_renderTemplate(  ) | .../HtmlDocument.php:577
7 | 0.1281 | 3642808 | Joomla\CMS\Document\HtmlDocument->getBuffer( $type = 'modules', $name = 'position-7', $attribs = ['name' => 'position-7', 'style' => 'well'] ) | .../HtmlDocument.php:803
8 | 0.1281 | 3642888 | Joomla\CMS\Document\Renderer\Html\ModulesRenderer->render( $position = 'position-7', $params = ['name' => 'position-7', 'style' => 'well'], $content = NULL ) | .../HtmlDocument.php:511
9 | 0.3278 | 6192000 | Joomla\CMS\Document\Renderer\Html\ModuleRenderer->render( $module = class  stdClass { public $id = '84'; public $title = 'Smart Search Module';  public $module = 'mod_finder'; public $position = 'position-7'; public  $content = ''; public $showtitle = '1'; public $params =  '{"searchfilter":"","show_autosuggest":"1","show_advanced":"0","field_size":20,"show_label":"0","label_pos":"top","alt_label":"","show_button":"0","button_pos":"right","opensearch":"1","opensearch_title":"","set_itemid":"0","layout":"_:default","moduleclass_sfx":"","module_tag":"div","bootstrap_size":"0","header_tag":"h3","header_class":"","style":"0"}';  public $menuid = '0'; public $name = 'finder'; public $style = NULL }, $attribs = ['name' => 'position-7', 'style' => 'well'], $content = NULL ) | .../ModulesRenderer.php:47
10 | 0.3278 | 6194656 | Joomla\CMS\Helper\ModuleHelper::renderModule( $module = class  stdClass { public $id = '84'; public $title = 'Smart Search Module';  public $module = 'mod_finder'; public $position = 'position-7'; public  $content = ''; public $showtitle = '1'; public $params =  '{"searchfilter":"","show_autosuggest":"1","show_advanced":"0","field_size":20,"show_label":"0","label_pos":"top","alt_label":"","show_button":"0","button_pos":"right","opensearch":"1","opensearch_title":"","set_itemid":"0","layout":"_:default","moduleclass_sfx":"","module_tag":"div","bootstrap_size":"0","header_tag":"h3","header_class":"","style":"0"}';  public $menuid = '0'; public $name = 'finder'; public $style = NULL }, $attribs = ['name' => 'position-7', 'style' => 'well'] ) | .../ModuleRenderer.php:98
11 | 0.3281 | 6221760 | include( '/home/beat/www/j/modules/mod_finder/mod_finder.php ) | .../ModuleHelper.php:200
12 | 0.3318 | 6246464 | ModFinderHelper::getQuery( $params = class  Joomla\Registry\Registry { protected $data = class stdClass { public  $searchfilter = ''; public $show_autosuggest = '1'; public  $show_advanced = '0'; public $field_size = 20; public $show_label = '0';  public $label_pos = 'top'; public $alt_label = ''; public $show_button =  '0'; public $button_pos = 'right'; public $opensearch = '1'; public  $opensearch_title = ''; public $set_itemid = '0'; public $layout =  '_:default'; public $moduleclass_sfx = ''; public $module_tag = 'div';  public $bootstrap_size = '0'; public $header_tag = 'h3'; public  $header_class = ''; public $style = '0' }; protected $initialized =  TRUE; public $separator = '.' } ) | .../mod_finder.php:54
13 | 0.3398 | 6249616 | FinderIndexerQuery->__construct( $options = ['filter' => 0, 'filters' => [0 => 0]] ) | .../helper.php:84
14 | 0.3399 | 6253064 | FinderIndexerQuery->processString( $input = NULL, $lang = 'en', $mode = 'AND' ) | .../query.php:236
15 | 0.3399 | 6253064 | html_entity_decode( $string = NULL, $flags = 3, $encoding = 'UTF-8' )

And can you tell me what re-indexing you mean and how to trigger that in the frontend? Isnt indexing triggerd by the backend? Maybe I'm missing something here?

The error appears in the Smart Search module like this:

image

avatar zero-24
zero-24 - comment - 23 Jan 2022

Please check: https://github.com/joomla/joomla-cms/blob/3.10-dev/administrator/components/com_finder/helpers/indexer/query.php#L175

and update it to $this->input = isset($options['input']) ? $options['input'] : '';

That should do the trick too.

avatar beat beat - change - 23 Jan 2022
Labels Added: ? ?
avatar beat
beat - comment - 23 Jan 2022

Please check: https://github.com/joomla/joomla-cms/blob/3.10-dev/administrator/components/com_finder/helpers/indexer/query.php#L175

and update it to $this->input = isset($options['input']) ? $options['input'] : '';

That should do the trick too.

Yes, it fixes it too, and as it's better typed, it's a better fix too. Thank you! Updated the PR, with mention in the commit message..

avatar zero-24
zero-24 - comment - 23 Jan 2022

Thanks merging it here :)

avatar zero-24 zero-24 - change - 23 Jan 2022
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2022-01-23 18:32:38
Closed_By zero-24
avatar zero-24 zero-24 - close - 23 Jan 2022
avatar zero-24 zero-24 - merge - 23 Jan 2022

Add a Comment

Login with GitHub to post a comment