No Code Attached Yet
avatar level420
level420
26 Aug 2022

Steps to reproduce the issue

Enable smart search aka finder and publish a finder search module somewhere or connect a menu item to the smart search item type.
Enable the load modules plugin.
Enable the smart search content plugin.
Create a site module of type custom with some content and place it at custom positon herewego.
Create an article and place a loadposition macro in that article like this:
{loadposition herewego}
Now the finder automatically indexes the new article.
Go to the search box and search for loadposition or herewego.

Expected result

I would not expect to see search results containing the article with the loadposition macro.
I would not expect the search suggestions list containing the search items loadposition and herewego.
Instead I would expect that the macro is deleted in this case before indexing.

Actual result

The search result does contain the article where the loadposition macro is placed and the suggestion list contains both loadposition and herewego.

System information (as much as possible)

joomla 4.2.0
mariadb 10.6
php 8.1 running as fpm

Additional comments

The code related is here:
https://github.com/joomla/joomla-cms/blob/4.2-dev/plugins/content/loadmodule/loadmodule.php#L43-L46
In case of $context being com_finder.indexer the macros loadposition, loadmodule and loadmoduleid should be removed.
I don't know the implication why in the case of finder triggering the onContentPrepare for loadmodule it is simply skipped, maybe for performace reasons.
I think this should be configurable in the loadmodule plugin or by adding an additional parameter to loadmodule like renderinindex or similar, which would allow to control the behaviour per macro.

avatar level420 level420 - open - 26 Aug 2022
avatar joomla-cms-bot joomla-cms-bot - change - 26 Aug 2022
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 26 Aug 2022
avatar level420 level420 - change - 26 Aug 2022
Title
finder index contains macros of loadmodule in search results
finder aka smart search index contains macros of loadmodule in search results
avatar level420 level420 - edited - 26 Aug 2022
avatar level420 level420 - change - 26 Aug 2022
The description was changed
avatar level420 level420 - edited - 26 Aug 2022
avatar richard67 richard67 - close - 20 Oct 2022
avatar richard67
richard67 - comment - 20 Oct 2022

Closing as having a pull request. Please test #38998 . Thanks in advance.

avatar richard67 richard67 - change - 20 Oct 2022
Status New Closed
Closed_Date 0000-00-00 00:00:00 2022-10-20 10:28:50
Closed_By richard67
avatar NiSHoW
NiSHoW - comment - 10 Jul 2023

This pull request has not yet been introduced. I found this issue in the latest version of Joomla 4.3.2.
Are there any updates on this?
I patched the code manually and it works by regenerating the smart search indexes.

avatar richard67
richard67 - comment - 10 Jul 2023

@NiSHoW Each pull request needs 2 successful human tests before it can be accepted. You can help with that by testing the pull request.

Add a Comment

Login with GitHub to post a comment