For not logged in users, site throw this error:
The website encountered an unexpected error. Please try again later.
LogicException: An anonymous user must be identifed by session ID. in Drupal\flag\FlagService->getAllEntityFlaggings() (line 194 of modules/flag/src/FlagService.php).Drupal\flag\FlagService->getAllEntityFlaggings(Object, Object) (Line: 24)
message_subscribe_email_flag_action_access('flag', Object, Object, Object)
call_user_func_array('message_subscribe_email_flag_action_access', Array) (Line: 402)
Drupal\Core\Extension\ModuleHandler->invokeAll('flag_action_access', Array) (Line: 175)
Drupal\flag\FlagType\FlagTypeBase->actionAccess('flag', Object, Object, Object) (Line: 314)
Drupal\flag\Plugin\Flag\EntityFlagType->actionAccess('flag', Object, Object, Object) (Line: 145)
Drupal\flag\Plugin\Flag\UserFlagType->actionAccess('flag', Object, Object, Object) (Line: 355)
Drupal\flag\Entity\Flag->actionAccess('flag', Object, Object) (Line: 98)
Drupal\flag\ActionLink\ActionLinkTypeBase->getAsFlagLink(Object, Object) (Line: 23)
Drupal\flag\Plugin\ActionLink\AJAXactionLink->getAsFlagLink(Object, Object) (Line: 48)
Drupal\flag\FlagLinkBuilder->build('user', '1', 'email_user')
call_user_func_array(Array, Array) (Line: 356)
Drupal\Core\Render\Renderer->doRender(Array, 1) (Line: 195)
Drupal\Core\Render\Renderer->render(Array, 1) (Line: 151)
Drupal\Core\Render\Renderer->Drupal\Core\Render\{closure}() (Line: 574)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 152)
Drupal\Core\Render\Renderer->renderPlain(Array) (Line: 166)
Drupal\Core\Render\Renderer->renderPlaceholder('callback=flag.link_builder%3Abuild&args[0]=user&args[1]=1&args[2]=email_user&token=GCdGR5FCVqLIzAYH2-ME7D7hVeeb5zSHsC4ULIdn5iY', Array) (Line: 698)
Drupal\big_pipe\Render\BigPipe->renderPlaceholder('callback=flag.link_builder%3Abuild&args[0]=user&args[1]=1&args[2]=email_user&token=GCdGR5FCVqLIzAYH2-ME7D7hVeeb5zSHsC4ULIdn5iY', Array) (Line: 552)
Drupal\big_pipe\Render\BigPipe->sendPlaceholders(Array, Array, Object) (Line: 305)
Drupal\big_pipe\Render\BigPipe->sendContent(Object) (Line: 112)
Drupal\big_pipe\Render\BigPipeResponse->sendContent() (Line: 374)
Symfony\Component\HttpFoundation\Response->send() (Line: 20)
| Comment | File | Size | Author |
|---|---|---|---|
| #31 | 2880521-31.patch | 986 bytes | jmester13 |
| #24 | message_subscribe-1.1.0--2880521-24--anonymous-user-must-be-identifed-by-session-id_flag-compatibility-issue.patch | 926 bytes | perfectcu.be |
Issue fork message_subscribe-2880521
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
joachim commentedThe signature of getAllEntityFlaggings() has changed in the latest alpha.
(BTW there is no point in tagging an issue with 'bug', since the category field already tells you that!)
Comment #3
admirernepali commentedIt still seems not fixed. I still get the same error. Error happens for anonymous users only.
Comment #4
joachim commentedYou are calling that method incorrectly.
Comment #5
admirernepali commentedI haven't changed or called any function. I just installed fresh module and while not logged it, getting that exception.
How do I suppose to call that method?
Comment #6
joachim commentedYou installed the new version of the module, but because the module is still in alpha, the API has changed.
message_subscribe_email_flag_action_access() is calling it wrong. It's not part of Flag. You need to change that code, or if it's another contrib module, get that module's maintainer to change it.
Comment #8
admirernepali commentedThanks for update.When I disable that module, on cron run I get this error:Any idea about this?This error is now not showing. Not sure what change I made.
Comment #9
dpiA related issue has been created for message_subscribe: https://github.com/Gizra/message_subscribe/issues/102
Comment #10
drupaleze commentedThis solved mine (at least the error is gone).
I simply located the Flag module and edited the file modules/flag/src/FlagService.php
On line 193 up to line 195, I commented those out
i.e.
/** DISABLED {
*throw new \LogicException('An anonymous user must be identifed by session ID.');
} */
For now, I don't have any issues, although I'm not really sure of the implications of this action.
Comment #11
oriol_e9gIn my case https://github.com/Gizra/message_subscribe/issues/102 fixes the problem.
Comment #12
eahonet commentedFor me it was message_subscribe_email module and the patch from here fixed:
https://www.drupal.org/project/message_subscribe/issues/2928789
Comment #13
zanvidmar commentedIn my case. The issue was that $account was not null but $session_id was.
That being said. Here is the patch that check if both variables (account and session_id) are null
Comment #14
turtletrail commented#13 did the trick for me.
thanks!
Comment #15
turtletrail commentedupdating my last reply, #13 should not be applied. See problem description: https://www.drupal.org/project/flag/issues/3075108#comment-13224836
Comment #16
martinma commentedHm,
I get it on /user/register and not at other pages (as it seem now for me) ...
I had the whole message stack installed too, so maybee there is a relation.
After uninstalling Message Digest UI:
Error: Call to undefined function message_digest_allowed_values_callback() in options_allowed_values() (Line 89 in /core/modules/options/options.module)
After
Message Subcribe Email
Message Subscribe UI
Message Subscribe
same Error as above
After unistalling Message Digest:
Error: Call to a member function getPath() on null in Drupal\config_translation\ConfigNamesMapper->getOverviewRoute() (Line 247 in /core/modules/config_translation/src/ConfigNamesMapper.php)
and for anonymous users:
Drupal\Component\Plugin\Exception\PluginNotFoundException: The "message_digest_interval" entity type does not exist. in Drupal\Core\Entity\EntityTypeManager->getDefinition() (Line 150 in /core/lib/Drupal/Core/Entity/EntityTypeManager.php).
/user/register still doesnt work!
Comment #17
martinma commentedComment #18
martinma commentedI wonder how this issue can be closed if it is not fixed!
If new users cant register, its major for me!
Comment #19
martinma commentedFollowed instruction of https://www.drupal.org/project/message_digest/issues/3095573 and removed field.storage.user.message_digest and also field.storage.user.message_subscribe_email. Register still doesnt work, same error message related to message module ...
Comment #20
zanvidmar commented@turtletrail got it right patch #13 should not be used. The problem in first place in my case wast that anonymous users should not have acces to content where flag is used. I fix this with redirect to login path.
Comment #21
zanvidmar commentedComment #22
Anonymous (not verified) commentedI encountered the same problem on a test D8 installation.
I deleted the Message Subscribe module's flags for term and user (so, just leaving its content flag), and this *appears* to have resolved the problem with the registration page.
Fortunately for me, I only need the content flag.
Sharing just in case somebody else has the same use case.
Comment #23
hansrossel commentedMoving this issue to the right project.
This patch is needed to fix it:
https://github.com/hdpe/message_subscribe/commit/9ca5e6082640b088087ae04...
Comment #24
perfectcu.be commentedHere's @hansrossel's patch in cweagans/composer-patches consumable form. Note that I applied his patch to the 1.1 version, not 8.x-1.x-dev as originally specified by @hansrossel.
New to cweagans/composer-patches?
Add something like this to your composer.json:
Comment #25
drupalbubb commentedPatch #24 works. Maintainers, please change the status to something else.
Comment #26
socialnicheguru commentedThis is a dupe of Causes fatal exception with flag module
Comment #27
avpadernoThis issue has been moved, but since it's closed, it won't probably be noticed. (I just found it because I was looking at the recently posted comments.)
It's probably better to open a new issue with the details useful to the maintainers of this project.
Comment #28
avpaderno(Actually, as comment #26 says, there is already an issue opened for this.)
Comment #29
pearls commentedThe issue mentioned in #26 seems to be closed, but the main problem mentioned above still persists when an anonymous user visits the site.
Tested versions
Drupal : 10.3.2
Message Subscribe : 8.x-1.3
Flag: 8.x-4.x-dev
Comment #30
pearls commentedThere is a loop between the issues. Each one references each other and at the end of the day, it does not provide any solution. There is no different situation for Version 2. The problem still persists.By the way, patch in #24 is not applied and does not work.
Comment #31
jmester13 commentedI have re-rolled the existing patch as some new code as been added.
Comment #32
bluegeek9 commentedThis issue seems to be the same as #3388551: "An anonymous user must be identified by session ID" crash on Drupal 10.
Comment #35
bluegeek9 commented