Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to J4 gives error JEventDispatcher when searching site #32805

Closed
cloudfaction opened this issue Mar 22, 2021 · 29 comments
Closed

Update to J4 gives error JEventDispatcher when searching site #32805

cloudfaction opened this issue Mar 22, 2021 · 29 comments

Comments

@cloudfaction
Copy link

cloudfaction commented Mar 22, 2021

Steps to reproduce the issue

update 3.10 to 4 site (4 beta 8 DEV)

Expected result

when searching in the updated site, get search results

Actual result

Search produces error: Class 'JEventDispatcher' not found

System information (as much as possible)

**`#Date: 2021-03-22 12:07:51 UTC
#Software: Joomla! 4.0.0-beta8-dev Development [ Mañana ] 2-February-2021 20:02 GMT

#Fields: datetime priority clientip category message
2021-03-22T12:07:51+00:00 CRITICAL ::1 error Uncaught Throwable of type Error thrown with message "Class 'JEventDispatcher' not found". Stack trace: #0 /Applications/MAMP/htdocs/jug/libraries/src/MVC/View/AbstractView.php(146): SearchModelSearch->getAreas()
#1 /Applications/MAMP/htdocs/jug/components/com_search/views/search/view.html.php(41): Joomla\CMS\MVC\View\AbstractView->get('areas')
#2 /Applications/MAMP/htdocs/jug/libraries/src/MVC/Controller/BaseController.php(692): SearchViewSearch->display()
#3 /Applications/MAMP/htdocs/jug/components/com_search/controller.php(34): Joomla\CMS\MVC\Controller\BaseController->display(false, false)
#4 /Applications/MAMP/htdocs/jug/libraries/src/MVC/Controller/BaseController.php(730): SearchController->display()
#5 /Applications/MAMP/htdocs/jug/components/com_search/search.php(13): Joomla\CMS\MVC\Controller\BaseController->execute('')
#6 /Applications/MAMP/htdocs/jug/libraries/src/Dispatcher/LegacyComponentDispatcher.php(69): require_once('/Applications/M...')
#7 /Applications/MAMP/htdocs/jug/libraries/src/Dispatcher/LegacyComponentDispatcher.php(71): Joomla\CMS\Dispatcher\LegacyComponentDispatcher::Joomla\CMS\Dispatcher{closure}('/Applications/M...')
#8 /Applications/MAMP/htdocs/jug/libraries/src/Component/ComponentHelper.php(389): Joomla\CMS\Dispatcher\LegacyComponentDispatcher->dispatch()
#9 /Applications/MAMP/htdocs/jug/libraries/src/Application/SiteApplication.php(206): Joomla\CMS\Component\ComponentHelper::renderComponent('com_search')
#10 /Applications/MAMP/htdocs/jug/libraries/src/Application/SiteApplication.php(245): Joomla\CMS\Application\SiteApplication->dispatch()
#11 /Applications/MAMP/htdocs/jug/libraries/src/Application/CMSApplication.php(266): Joomla\CMS\Application\SiteApplication->doExecute()
#12 /Applications/MAMP/htdocs/jug/includes/app.php(63): Joomla\CMS\Application\CMSApplication->execute()
#13 /Applications/MAMP/htdocs/jug/index.php(32): require_once('/Applications/M...')
#14 {main}`**

Additional comments

above the results of everything.php that shows the error.

@ReLater
Copy link
Contributor

ReLater commented Mar 22, 2021

All I know is that there was a promise:

Notes on Search (com_search)

Search (com_search) will be decoupled in Joomla 4.x. Search (com_search) will migrate to Joomla 4. After migration, you'll need to update it to the Joomla 4.x version via com_installer. It will continue to be maintained, but more the same way a third-party extension is by receiving updates via com_installer. ... earch will still be available at https://extensions.joomla.org/category/official-extensions/.

( https://docs.joomla.org/Joomla_3.x_to_4.x_Step_by_Step_Migration )

I haven't heard any news about that for a long time.

@wilsonge
Copy link
Contributor

Search was decoupled. There's a branch here containing the fixes. You should have an update site setup on update - see: https://github.com/joomla-extensions/search/blob/4.0-dev/src/components/com_search/Model/SearchModel.php

@Hackwar
Copy link
Member

Hackwar commented Jan 17, 2022

As @wilsonge said, this is something that is solved by properly updating the com_search component. Thus this issue can be closed.

@Quy Quy closed this as completed Jan 17, 2022
@ConfidantCommunications

For me, "properly updating" involved manually copying the com_search folders from /administrator/components and /components from a fresh (non-upgraded) install of Joomla 4. If anyone knows of a more sane method please do tell.


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

@Hackwar
Copy link
Member

Hackwar commented Feb 20, 2022

That would be really astonishing, since com_search isn't part of Joomla 4 anymore.

@gerdkolano
Copy link

I updated from 3.6.10 to 4.1.0. Using the smart search module produced the error
class JEventDispatcher not found.
The command grep -R 'JEvent' JOOMLA__ROOT/
found JEvent in JOOMLA__ROOT/components/com_search/models/search.php
Using in the administrator's backend IExtensions:Manage
I first disabled all search and Search related entries
and then uninstalled all search and Search related entries.

Using System Dashboard >> Update >> Joomla >> Check for Updates
I clicked on
Reinstall Joomla! core files
Success.
The command grep -R 'JEvent' JOOMLA__ROOT/
did not find JEvent any more.

Home Dashboard >> Components >> Smart Search >> Index
showed a lot of entries
and voilà
using the Search feature in the front end succeeded.


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

@hakanara
Copy link

Can you please add the link to the component here?
https://downloads.joomla.org/extensions

Also what about the translations of this component. Most probably translaters are not aware of it yet.


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

@aspergerway
Copy link

I have this problem right away. I did a clean install of joomla 4.1.2 and Helix Ultimate 2.0.7.
Even reinstalling the joomla core the problem does not go away.
Every time I search for something it appears:
0
Class 'JEventDispatcher' not found

What should I do?

To upgrade to joomla 4 I preferred to recreate my site from scratch.
But until I solve this thing I can't go on.
Help me please!


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

@aspergerway
Copy link

I get the problem.
I had understood that in clean installations the com_search component was not present but the advanced search was present.
So when I created the module I saw Search and chose that one, instead I had to choose the advanced search one.
But if they removed the search component, why the hell was the search module left?
I've been going crazy for a week!


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

@brianteeman
Copy link
Contributor

Did you install joomla and then helix - or was it an all in one installation.

I ask because on a clean joomla install there is only one search module so I wonder how you have the module.

image

@joomla joomla deleted a comment from aspergerway Apr 20, 2022
@aspergerway
Copy link

aspergerway commented Apr 20, 2022 via email

@aspergerway
Copy link

aspergerway commented Apr 20, 2022 via email

@aspergerway
Copy link

I solved it by uninstalling the old search package and all related extensions.


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

@ConfidantCommunications

I can confirm the solution by @aspergerway. Turns out my earlier solution involved copying over an older version of the old search package (I thought it was included with Joomla 4 but it wasn't).

@ConfidantCommunications

However the Smart Search indexer currently reports "undefined Call to undefined method Joomla\Component\Finder\Administrator\Indexer\Helper::getContentPath()" as some other people are experiencing.

@ConfidantCommunications

I removed the finder plugins for Phoca Download and now it indexes fine.

@Hackwar
Copy link
Member

Hackwar commented May 14, 2022

Please don't post (new) stuff in closed issues. No one is looking at closed issues.

@ConfidantCommunications

Remember, this is in the spirit of helping out anybody who came here since the issue was closed on January 17. If it is somehow interfering with your workflow then I am sorry.

@Hackwar
Copy link
Member

Hackwar commented May 14, 2022

Sorry for being so direct, but the place for support is forum.joomla.org. The original issue was solved by pointing to an update of com_search, everything else after that was unrelated to that.

@guntiszarinsh
Copy link

Where can i find any developer documentation for Joomla 4?

@alikon
Copy link
Contributor

alikon commented Sep 19, 2022

@guntiszarinsh
Copy link

https://manual.joomla.org/

Funny :) Did you ever visit this site? It is almost empty.

This is unreleased documentation for Joomla! Programmers Documentation v4.3.x (upcoming) version.

Looks like more easily to write new CMS (with blackjack and hookers) that to upgrade my old extensions from J3.x to J4.x

@brianteeman
Copy link
Contributor

Yes that was a very unhelpful link as that site is just beginning.

I would check out this link https://docs.joomla.org/Potential_backward_compatibility_issues_in_Joomla_4.

And this one (still a work in progress) https://github.com/nikosdion/joomla_extensions_development

@alikon
Copy link
Contributor

alikon commented Sep 19, 2022

did you know that we are a "real" community driven project ?
and all of us do it for free, in their free time ?
so my question to you is where is your contribution ?
before to complain ask to yourself what i've done to enanche the project
did you ?

@brianteeman
Copy link
Contributor

@alikon thats not helpful and as vp I would expect more

@guntiszarinsh
Copy link

guntiszarinsh commented Sep 19, 2022

did you know that we are a "real" community driven project ? and all of us do it for free, in their free time ? so my question to you is where is your contribution ? before to complain ask to yourself what i've done to enanche the project did you ?

i hate do that for client 10 years ago... as i hate it do now :) bot they pay :)
looks like not all of you do that for free :) chronoforms for sample :)
i just looking for some documentation...
at least, i will do my job gob trought code... but if your excuse is that you are open free, and so terible, then better dont do that.

For sample, checkout Yii project, comunity and documentation.

@alikon
Copy link
Contributor

alikon commented Sep 19, 2022

i'm sorry to have a completely different perspective from yours, but objective facts must be exposed, and both of you are on the wrong side, first do it and then complain, only complain is not productive

@guntiszarinsh
Copy link

Yes that was a very unhelpful link as that site is just beginning.

I would check out this link https://docs.joomla.org/Potential_backward_compatibility_issues_in_Joomla_4.

This one sometimes helps, but.... for sample JAdministratorHelper::findOption():

JAdministratorHelper has been removed without replacement. (It's been merged into JApplicationAdministrator.)

It is not more static accessable, $this->option not always accessible or null. At least find out $this->app->findOption(), or finally

$app = \Joomla\CMS\Factory::getApplication()

to get access to App.
With JDispatcher same 'shit'... $dispatcher->dispatch() no mo accept array as parameter - costly refactoring,
there is solusion as

\Joomla\CMS\Factory::getApplication()->triggerEvent()

but will be deprecated at version 5 (next year? )

Maybe solutions i found is wrrong, but i work only 3 days on issue - upgrade components from J3.x to J4.x. Previous time seen Joomla ~7 years ago.

And this one (still a work in progress) https://github.com/nikosdion/joomla_extensions_development

Still in progress :( (was looking, does ever exist any book about joomla 4) But read again, just to upgrade extensions (last time we spent 3 months for development (if i remember right), this time we dont have so much time)

@guntiszarinsh
Copy link

ah and, yes, i was check CMS top - links i visit Joomla was in average top 3. :) If i dont like Joomla so much, how bad is other CMS?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests