Skip to content

Comments

[4.2] Inject the database into the finder classes#37611

Merged
roland-d merged 7 commits intojoomla:4.2-devfrom
Digital-Peak:j4/finder/db-cleanup
Jun 18, 2022
Merged

[4.2] Inject the database into the finder classes#37611
roland-d merged 7 commits intojoomla:4.2-devfrom
Digital-Peak:j4/finder/db-cleanup

Conversation

@laoneo
Copy link
Member

@laoneo laoneo commented Apr 22, 2022

Summary of Changes

Ongoing effort to inject the database into components and get rid of the deprecated Factory::getDbo(); calls. This pr injects the database in the finder component instead of using the factory to get it from.

Testing Instructions

  • Make sure the smart search content plugin is enabled
  • Edit an article and add a description text with the word hello
  • Save the article
  • Go to the url /administrator/index.php?option=com_finder&view=index and hit the Index button
  • Create a search module for the front
  • Search for "hello"

Actual result BEFORE applying this Pull Request

All works.

Expected result AFTER applying this Pull Request

All works.

@richard67 richard67 added the PBF Pizza, Bugs and Fun label Apr 22, 2022
@RickR2H
Copy link
Member

RickR2H commented Apr 22, 2022

I have tested this item ✅ successfully on 3911c15


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

@pabloarias
Copy link

Sorry, not able to test it.

In Joomla 4.2.0-alpha2-dev with PHP 8.0 and 8.1: Error before apply the path, when trying to create Smart Search module: An error has occurred. 0 Attempt to assign property "params" on null.

In Joomla 4.1.3-dev with PHP 8.1: if I apply the path I obtain an error in frontend: ClassNotFoundError. Details:

Symfony\Component\ErrorHandler\Error\ClassNotFoundError:
Attempted to load trait "DatabaseAwareTrait" from namespace "Joomla\Database".
Did you forget a "use" statement for another namespace?

at /shared/httpd/Joomla_4.1.3-dev/htdocs/administrator/components/com_finder/src/Service/HTML/Finder.php:26

Thank you and best regards


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

@RickR2H
Copy link
Member

RickR2H commented Apr 22, 2022

@pabloarias Make sure you are on the 4.2 branch!

@roland-d roland-d merged commit 3c0dabb into joomla:4.2-dev Jun 18, 2022
@roland-d roland-d deleted the j4/finder/db-cleanup branch June 18, 2022 13:55
@roland-d
Copy link
Contributor

Thanks everybody.

@roland-d roland-d added this to the Joomla 4.2.0 milestone Jun 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PBF Pizza, Bugs and Fun

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants