You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have an app integration that is dependent on files_fulltextsearch. I hook into the EventDispatcher and listen for specific events. It has been a while since I upgraded my app (along with upgrading files_fulltextsearch), but in attempting to do so I noticed that all the events stopped working. I noticed that this app (files_fulltextsearch_tesseract) is having the same issues I am.
When I print out the names of these new versions of the events, I get OCP\EventDispatcher\GenericEvent instead of the expected event names.
I believe this means that all apps that are dependent on these events are currently broken or they've figured out they have to listen to the event OCP\EventDispatcher\GenericEvent and figure out how to handle the various arguments coming through.
I think the fix is to go back to using $this->eventDispatcher->dispatch on the line I linked to above. Then the dependent apps can switch to the new event names and they will start working again.
I'm happy to submit a PR to fix it if that is desired.
Affected files:
lib/Service/ExtensionService.php
The text was updated successfully, but these errors were encountered:
Thanks for this hint! This here is currently working on NC 25.0.2 with the latest version:
//fixed thanks to this hint: https://github.com/nextcloud/files_fulltextsearch/issues/159
$eventDispatcher->addListener(
'OCP\EventDispatcher\GenericEvent',
function (GenericEvent $e) {
$subject = $e->getSubject();
$this->logger->info(self::APP_NAME." {$subject} event catched");
switch($subject) {
case "Files_FullTextSearch.onFileIndexing":
$this->mailService->onFileIndexing($e);
break;
case "Files_FullTextSearch.onSearchRequest":
$this->mailService->onSearchRequest($e);
break;
case "Files_FullTextSearch.onSearchResult":
$this->mailService->onSearchResult($e);
break;
}
$this->mailService->onSearchResult($e);
}
);
However I fully agree that it might be better to switch to proper distinct events that subclass OCP\EventDispatcher\Event in this app here, because the current workaround is rather ... ugly and generic instead (phun intended).
Not sure if that's possible with Nextcloud accross Apps? These changes seem to origin starting NC22 where they refactored to their own Event-Bus away from Symphony, that's at least how I understand it from the depcrecated notes. Documentation could be really better in that regard in regards to NC itself.
I have an app integration that is dependent on files_fulltextsearch. I hook into the EventDispatcher and listen for specific events. It has been a while since I upgraded my app (along with upgrading files_fulltextsearch), but in attempting to do so I noticed that all the events stopped working. I noticed that this app (files_fulltextsearch_tesseract) is having the same issues I am.
I did some digging and noticed that files_fulltextsearch was still calling
$this->dispatch
in thelib/Service/ExtensionService.php
file. But thedispatch
function was changed to call$this->eventDispatcher->dispatchTyped
in this commit: df0ec11#diff-966d10a7ed8f3b02fa5f56cb2ad73d79b5a4cb1d947f6817a389e40c3f6569cdR123When I print out the names of these new versions of the events, I get
OCP\EventDispatcher\GenericEvent
instead of the expected event names.I believe this means that all apps that are dependent on these events are currently broken or they've figured out they have to listen to the event
OCP\EventDispatcher\GenericEvent
and figure out how to handle the various arguments coming through.I think the fix is to go back to using
$this->eventDispatcher->dispatch
on the line I linked to above. Then the dependent apps can switch to the new event names and they will start working again.I'm happy to submit a PR to fix it if that is desired.
Affected files:
lib/Service/ExtensionService.php
The text was updated successfully, but these errors were encountered: