- Issue created by @Grimreaper
Confirming the issue on Drupal 10.1.1
With the same version (8.x-1.7) on Drupal 9.5.9, it works fine.- 🇬🇧United Kingdom cwales95
Just came across this myself on Drupal 10.1.0 and profile version 8.x-1.7.
- 🇬🇧United Kingdom cwales95
Something has changed during the code execution I think. preSave is being called on the Profile before the User entity is saved i.e before a uid is available.
- 🇪🇸Spain paucala
This have sense, I have been able to create a user and then create a profile for this user, but not at the same time.
- Assigned to TomTech
- 🇺🇸United States TomTech
This is because of the hardening of
isAnonymous()
that occurred in 10.1 See: [#3345487]Patch attached to convert
isAnonymous()
to!isAuthenticated()
. (And the inverse)Occurs in 3 places.
(Also, added a gitignore file)
- Status changed to Needs review
over 1 year ago 10:31pm 24 July 2023 - last update
over 1 year ago 23 pass -
jsacksick →
committed 40d1e605 on 8.x-1.x authored by
TomTech →
Issue #3371850 by TomTech: Drupal 10.1: fatal error on account creation
-
jsacksick →
committed 40d1e605 on 8.x-1.x authored by
TomTech →
- Status changed to Fixed
over 1 year ago 11:25am 25 July 2023 Automatically closed - issue fixed for 2 weeks with no activity.
- First commit to issue fork.
- Status changed to Fixed
12 months ago 11:02am 30 November 2023 - 🇬🇧United Kingdom JeremySkinner
I'd like to re-open this issue if possible as the fix in #8 causes some other issues.
Rather than checking
isAuthenticated
I'd recommend going back to checkingisAnonymous
but also checkisNew
as well. The problem withisAuthenticated
is that other modules may have switched out the logic here.For example, the decoupled_auth module allows the concept of users without logins (eg for CRM systems where a user record may exist for CRM purposes, but not have a login attached to it), to do this it switches out the logic of isAuthenticated.
The change in #8 means that the decoupled_auth module no longer works with profile.
By using a combination of isAnonymous() and isNew(), you'd preserve the original behaviour without breaking modules that swap out the logic of isAuthenticated.
I've created an issue fork to propose the changes, I'd appreciate if you'd consider it. Many thanks.
- Merge request !21Issue #3371850: Fatal errors on account creation - restore isAnonymous check → (Merged) created by JeremySkinner
- last update
12 months ago 23 pass - 🇦🇹Austria drupalfan2
I have the same problem.
Patch #15 helps so far.Hoping for a new version of the profile module with correct solution in it.
Thank you. - 🇺🇸United States chucksimply
#8 Applied to 1.7, and fixes the error. I tried the merge patch on #15 first, but it failed to apply.
- 🇬🇧United Kingdom MrDaleSmith
The patch on #15 applies cleanly to the dev version of the module, as is standard practice for Drupal patches.
- 🇺🇸United States mlncn Minneapolis, MN, USA
This is a critical bug— the maintainers should make a release of this module (double-checks real quickly to make sure i am not a maintainer of this module)
- 🇬🇧United Kingdom cwales95
I can confirm this is still an issue. The patch in #8 seemingly works.
- 🇩🇪Germany Anybody Porta Westfalica
@jsacksick: Sorry to disturb, could you please have a look at the previous comments?
This major issue currently still breaks sites using the stable version of this module. Furthermore #14 raises concerns about the fix!
I'd like to suggest
- Reopening the issue if it makes sense
or
- Creating a follow-up if needed
or
- Tag a new stable release, if this fix is fine from your perspective, so that sites don't break with the "stable" version.Feedback would be great, thank you!
- 🇬🇧United Kingdom JeremySkinner
I'm very happy to create a follow up issue if needed, but the fix that's already been merged is not equivalent with the original behaviour. The fix I proposed in #15 is equivalent to the original correct behavior and would be much better if this could go into a stable release.
- 🇫🇷France Grimreaper France 🇫🇷
Hi,
Finally back on my side project where I encountered the issue. Thanks for the fix! I was able to update from Core 10.0 to 10.2 and updating the Profile module, no fatal error so far.