Email registration module when updated to 8.x-1.0-rc3 conflicts with Profile module and throws below exception -
Drupal\Core\Entity\EntityStorageException: Entity validation was skipped. in Drupal\Core\Entity\Sql\SqlContentEntityStorage->save() (line 756 of core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php).
Email registration module version 8.x-1.x-dev (2015-Apr-03) works well. Updates in 8.x-1.0-rc3 version of username (E.g.
- $name = $account->getUsername();
+ $name = $account->getAccountName();
) throws exception and conflicts with Profile module (With both Profile version - 8.x-1.0-alpha4 and 8.x-1.x-dev)
Below is the detailed exception error -
Drupal\Core\Entity\EntityStorageException: Entity validation was skipped. in Drupal\Core\Entity\Sql\SqlContentEntityStorage->save() (line 756 of core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php).
Drupal\user\Entity\User->preSave(Object) (Line: 434)
Drupal\Core\Entity\EntityStorageBase->doPreSave(Object) (Line: 291)
Drupal\Core\Entity\ContentEntityStorageBase->doPreSave(Object) (Line: 389)
Drupal\Core\Entity\EntityStorageBase->save(Object) (Line: 747)
Drupal\Core\Entity\Sql\SqlContentEntityStorage->save(Object) (Line: 358)
Drupal\Core\Entity\Entity->save() (Line: 47)
email_registration_user_insert(Object)
call_user_func_array('email_registration_user_insert', Array) (Line: 402)
Drupal\Core\Extension\ModuleHandler->invokeAll('user_insert', Array) (Line: 167)
Drupal\Core\Entity\EntityStorageBase->invokeHook('insert', Object) (Line: 418)
Drupal\Core\Entity\ContentEntityStorageBase->invokeHook('insert', Object) (Line: 470)
Drupal\Core\Entity\EntityStorageBase->doPostSave(Object, ) (Line: 304)
Drupal\Core\Entity\ContentEntityStorageBase->doPostSave(Object, ) (Line: 395)
Drupal\Core\Entity\EntityStorageBase->save(Object) (Line: 747)
Drupal\Core\Entity\Sql\SqlContentEntityStorage->save(Object) (Line: 358)
Drupal\Core\Entity\Entity->save() (Line: 92)
Drupal\user\RegisterForm->save(Array, Object)
call_user_func_array(Array, Array) (Line: 111)
Drupal\Core\Form\FormSubmitter->executeSubmitHandlers(Array, Object) (Line: 51)
Drupal\Core\Form\FormSubmitter->doSubmitForm(Array, Object) (Line: 583)
Drupal\Core\Form\FormBuilder->processForm('user_register_form', Array, Object) (Line: 314)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 74)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 574)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
call_user_func_array(Object, Array) (Line: 139)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 62)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 98)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 77)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 50)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 628)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
Comment | File | Size | Author |
---|---|---|---|
#3 | 2777701_validate_user.patch | 712 bytes | R.Muilwijk |
|
Comments
Comment #2
renukakulkarni CreditAttribution: renukakulkarni commentedComment #3
R.Muilwijk CreditAttribution: R.Muilwijk commentedThe user should first be validated if this is required.
Comment #4
R.Muilwijk CreditAttribution: R.Muilwijk commentedComment #5
kscheirerRan into the same issue, patch fixed it for me, thanks!
Comment #6
a.dmitriiev CreditAttribution: a.dmitriiev as a volunteer commentedThe patch also worked for me, please add to DEV version at least.
Thanks!
Comment #7
gregglesI don't use Drupal 8 yet, so pardon if my feedback isn't useful.
I hear that there's an exception being thrown. It looks like this would prevent the exception and bail with an error in some cases. Is the proposed patch fixing the underlying bug or just hiding it?
Comment #8
kscheirerI think this fixes the problem: "Entity validation was skipped". The patch allows validation to happen, we're not hiding the exception.
Comment #10
gregglesThanks for the explanation/pointers, Karl!
So the expectation is the logger call will happen infrequently and most of the time the code will actually continue to the save. Works for me.
Thanks to you, R.Muilwijk, and others for your help fixing this. It's committed now.
Comment #11
kscheirerThanks greggles!
Comment #13
pfrenssenWhy was there no test added for this?
I'm asking because in #657472: Add setting to allow users to login with email address or username this code was removed again by accident and this didn't cause any failures. Luckily @andypost saw this and was familiar with this issue and prevented this fix from disappearing again.
Any fix that is not tested can regress at any point in the future.
Comment #14
greggles@pfrenssen probably for the same reason most things aren't done: the people doing the work didn't think it was worth it. If you think it's worth it, please reopen the issue and add it :)
Comment #15
R.Muilwijk CreditAttribution: R.Muilwijk at Trinoco commented