- Issue created by @jaydenpearly
- ๐ช๐ธSpain webtematica
Hi, i confirm the same problem in Drupal 10 with PHP 8.1. and the dev version of the module.
It needs to push twice to change the state of the flag. - ๐บ๐ธUnited States aharown07
I am seeing this error also since moving from Drupal 9.5 to 10.
My flags and rules were working perfectly in 9.5 but now one flag has to be clicked twice, and another goes to an error page "The website encountered an unexpected error. Please try again later." Then clicking the flag appears to not execute the rule.
- ๐ฎ๐ณIndia chetan 11
chetan 11 โ made their first commit to this issueโs fork.
- Status changed to Needs review
12 months ago 12:16pm 24 November 2023 - ๐ฎ๐ณIndia chetan 11
Hi,
I have fixed the above error "Error: Argument #1 ($event) must be of type object", please check the solution in raised MR.
Thanks. - ๐บ๐ธUnited States tawellman
I am getting the same thing. Is there a patch I am missing?
The website encountered an unexpected error. Try again later. TypeError: Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher::dispatch(): Argument #1 ($event) must be of type object, string given, called in /home/sewardsdevel9/sewards10/web/modules/contrib/rules_flag/rules_flag.module on line 45 in Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch() (line 89 of core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php). rules_flag_flagging_delete() call_user_func_array() (Line: 409) Drupal\Core\Extension\ModuleHandler->Drupal\Core\Extension\{closure}() (Line: 388) Drupal\Core\Extension\ModuleHandler->invokeAllWith() (Line: 416) Drupal\Core\Extension\ModuleHandler->invokeAll() (Line: 215) Drupal\Core\Entity\EntityStorageBase->invokeHook() (Line: 900) Drupal\Core\Entity\ContentEntityStorageBase->invokeHook() (Line: 462) Drupal\Core\Entity\EntityStorageBase->delete() (Line: 753) Drupal\Core\Entity\Sql\SqlContentEntityStorage->delete() (Line: 360) Drupal\Core\Entity\EntityBase->delete() (Line: 344) Drupal\flag\FlagService->unflag() (Line: 116) Drupal\flag\Controller\ActionLinkNoJsController->unflag() call_user_func_array() (Line: 123) Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 627) Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 124) Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97) Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 181) Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 76) Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 58) Drupal\Core\StackMiddleware\Session->handle() (Line: 48) Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 28) Drupal\Core\StackMiddleware\ContentLength->handle() (Line: 32) Drupal\big_pipe\StackMiddleware\ContentLength->handle() (Line: 106) Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 85) Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 50) Drupal\ban\BanMiddleware->handle() (Line: 48) Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51) Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 36) Drupal\Core\StackMiddleware\AjaxPageState->handle() (Line: 51) Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 704) Drupal\Core\DrupalKernel->handle() (Line: 19)
I am on:
- Drupal 10.2.2
- Rules 8.x-3.0-alpha8+2-dev
- Rules Flag 1.0.2+1-dev
I install the Rules flag module and try to flag an ECK entity and get the above WSOD error. Refresh the screen and entity displays fine and is flagged like it should be. When I unflag it, error shows back up. NO rules written yet. Example Rules have also been disabled.
Uninstall the module and flagging works a designed.
I am migrating a site that relied a lot on Rules and Flags. Is there any chance someone can help me find a solution?
- ๐บ๐ธUnited States tawellman
I think I figured it out. Looks like maybe the arguments in lines 23, 32, and 45 are in the wrong order. Changed them to the following and things look to be working.
23 $event_dispatcher->dispatch($event, UserFlaggedEvent::EVENT_NAME); 32 $event_dispatcher->dispatch($event, "rules_flag_entity_flagged:$entity_type"); 45 $event_dispatcher->dispatch($event, "rules_flag_entity_unflagged:$entity_type");
I know just enough to be a little useful sometimes. Never wrote a patch, so if someone could handle that end, that would be cool!
Hope this helps!
- ๐บ๐ธUnited States aharown07
tawellman's edits to rules_flag.module (for me ver 1.0.3) are also working on my sites.
I also don't know how to roll patches the git way. I see instructions here โ and here โ , but I currently manage a single public website and one dev version... so it has not made sense to learn Git just for that.
... likewise for interdiff โ and drupalorg-cli.But here's an old fashioned diff patch.
- ๐จ๐ณChina drupalfan79
the rout cause is the change in Drupal core 9.1 https://www.drupal.org/project/drupal/issues/3055194 โ
-
drupalfan79 โ
committed 81c2b442 on 1.0.x
Issue #3375074 by chetan 11, aharown07, drupalfan79: Error: Argument #1...
-
drupalfan79 โ
committed 81c2b442 on 1.0.x
- Status changed to Fixed
7 months ago 2:54am 20 April 2024 Automatically closed - issue fixed for 2 weeks with no activity.