? Pending

User tests: Successful: Unsuccessful:

avatar sakiss
sakiss
26 Feb 2020

Summary of Changes

The class: administrator/components/com_finder/src/Indexer/Adapter.php
is extended by the finder plugins.

It contains the function: getListQuery which in most cases is overwritten by the finder plugins.
Though if it is not overwritten, an exception is thrown, since it executes an empty query, which in turn generates an sql error.

In that case the Indexer's index will never finish.

Do note that this function is not abstract, hence should work even if it is not declared in the plugins.
Also the finder plugins do not necessarily return items (e.g. onFinderIndexAfterPurge event).

Testing Instructions

Remove the function: getListQuery from the file: plugins/finder/content/content.php

Then go to com_finder and press the "Index" btn

Expected result

Index to finish

Actual result

Will never finish

Documentation Changes Required

No

avatar sakiss sakiss - open - 26 Feb 2020
avatar sakiss sakiss - change - 26 Feb 2020
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 26 Feb 2020
Category Administration com_finder
avatar sakiss sakiss - change - 26 Feb 2020
Title
Fix not set getListQuery in finder plugin
[4.0] Fix not set getListQuery in finder plugin
avatar sakiss sakiss - edited - 26 Feb 2020
avatar sakiss sakiss - change - 26 Feb 2020
The description was changed
avatar sakiss sakiss - edited - 26 Feb 2020
avatar sakiss sakiss - change - 26 Feb 2020
The description was changed
avatar sakiss sakiss - edited - 26 Feb 2020
avatar sakiss sakiss - change - 26 Feb 2020
Labels Added: ?
avatar sakiss sakiss - change - 26 Feb 2020
The description was changed
avatar sakiss sakiss - edited - 26 Feb 2020
avatar Hackwar
Hackwar - comment - 27 Feb 2020

If you are not implementing getListQuery(), then you have to override getItems() and getItem(). Simply returning an empty array here will not be the solution.

avatar sakiss
sakiss - comment - 27 Feb 2020

If you are not implementing getListQuery(), then you have to override getItems() and getItem(). Simply returning an empty array here will not be the solution.

Your argument is sensible. Though:

  1. Technically since that function is not abstract the plugins are not forced to implement it and executing an empty sql query (i.e. generate sql error) is not so elegant.
  2. There are finder events that do not require the link items to be fetched (e.g. onFinderIndexAfterPurge).
avatar sakiss sakiss - change - 11 Mar 2020
The description was changed
avatar sakiss sakiss - edited - 11 Mar 2020
avatar maikol-ortigueira
maikol-ortigueira - comment - 2 Apr 2020

I have tested this item ? unsuccessfully on 99f0a54

I tested the patch with a negative result. The only difference is that now I can see a progress bar that never ends.


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

avatar maikol-ortigueira maikol-ortigueira - test_item - 2 Apr 2020 - Tested unsuccessfully
avatar ggenovino
ggenovino - comment - 11 Apr 2020

I have tested this item ? unsuccessfully on 99f0a54

it gave me this result:

undefined

syntax error, unexpected '{', expecting function (T_FUNCTION) or const (T_CONST)


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

avatar ggenovino ggenovino - test_item - 11 Apr 2020 - Tested unsuccessfully
avatar sakiss
sakiss - comment - 14 Apr 2020

@ggenovino This is a syntax error, which does not come from the patch.
Please check if you accidentally removed a bracket (}), trying to remove the getListQuery function

avatar sakiss sakiss - change - 15 Jun 2020
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2020-06-15 17:23:38
Closed_By sakiss
avatar sakiss sakiss - close - 15 Jun 2020

Add a Comment

Login with GitHub to post a comment