After updating drupal core to 8.3.3 I get the following error:
Drupal\Core\Entity\EntityStorageException: Update existing 'node' entity revision while changing the revision ID is not supported. in Drupal\Core\Entity\Sql\SqlContentEntityStorage->save() (line 777 of core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php).
Drupal\Core\Entity\EntityStorageBase->save(Object) (Line: 768)
Drupal\Core\Entity\Sql\SqlContentEntityStorage->save(Object) (Line: 364)
Drupal\Core\Entity\Entity->save() (Line: 215)
Drupal\lingotek\LingotekContentTranslationService->setTargetStatus(Object, 'en', 'EDITED') (Line: 132)
Drupal\lingotek\LingotekContentTranslationService->setSourceStatus(Object, 'EDITED') (Line: 250)
lingotek_entity_update(Object)
call_user_func_array('lingotek_entity_update', Array) (Line: 402)
Drupal\Core\Extension\ModuleHandler->invokeAll('entity_update', Array) (Line: 169)
Drupal\Core\Entity\EntityStorageBase->invokeHook('update', Object) (Line: 441)
Drupal\Core\Entity\ContentEntityStorageBase->invokeHook('update', Object) (Line: 470)
Drupal\Core\Entity\EntityStorageBase->doPostSave(Object, 1) (Line: 326)
Drupal\Core\Entity\ContentEntityStorageBase->doPostSave(Object, 1) (Line: 395)
Drupal\Core\Entity\EntityStorageBase->save(Object) (Line: 768)
Drupal\Core\Entity\Sql\SqlContentEntityStorage->save(Object) (Line: 364)
Drupal\Core\Entity\Entity->save() (Line: 286)
Drupal\node\NodeForm->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: 585)
Drupal\Core\Form\FormBuilder->processForm('node_page_vertical_edit_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: 144)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 64)
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: 118)
Drupal\cdn\StackMiddleware\DuplicateContentPreventionMiddleware->handle(Object, 1, 1) (Line: 50)
Drupal\ban\BanMiddleware->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: 656)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
Comment | File | Size | Author |
---|---|---|---|
#10 | when_updating_to_core-2878570-10.patch | 1.25 KB | jrockowitz |
#2 | lingotek-revision_id_not_supported_error-2878570.patch | 1.49 KB | vomiand |
Comments
Comment #2
vomiand CreditAttribution: vomiand at FFW commentedThis seems to be happening cause entity->save is being called while executing hook_update of the same entity.
Comment #3
vomiand CreditAttribution: vomiand at FFW commentedComment #4
penyaskitoThe 8.x-2.x branch was created for getting this fixed. Please test that one for your use case.
The attached patch will break Lingotek module functionality.
Comment #5
vomiand CreditAttribution: vomiand at FFW commentedThe 8.x-2.x branch update somehow breaks the link between nodes and lingotek.
All translations have this status:
Translation exists, but it is not being tracked by Lingotek.
Can we have this fix for 8.x-1.x until 8.x-2.x gets fixed or something?
Comment #6
penyaskitoDid you run drush updb or visited the update page in that site? If not, that's an unknown bug that we need to tackle.
Could you please test in a dev environment that you can recreate from a backup later just in case?
Comment #7
penyaskitoWe cannot fix this in 8.x-1.x, because it's an architectural problem. The 8.x-2.x branch was built exactly for fixing this issue and other related to versioning that were caused because of storing metadata in the entity itself.
Comment #8
penyaskitoRe-reading this patch looks safe to commit. However, it would be great having a test showing the problem.
Comment #9
vomiand CreditAttribution: vomiand at FFW commentedWhen running drush updb I get the error reported here:
https://www.drupal.org/node/2878924
What I did is add another condition in the if from line 281 from lingotek.install:
if ($entity && isset($entity->lingotek_document_id) && isset($entity->lingotek_profile->entity)) {
which ran the update, but got translations into the state of: 'Translation exists, but it is not being tracked by Lingotek.'.
Comment #10
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedThe patch did not resolve the issue for me. I ran into the same error for some custom code and had to use the @internal ContentEntityInterface::updateLoadedRevisionId method to get the second entity save to work.
The attached patch is just a work-around and not a long term solution. As soon as 8.2 has a tagged release I will switch over to it.
Comment #12
penyaskitoRequeued #2 with "PHP 7 & MySQL 5.5, D8.3". Those are failing with HEAD with the same error, if this passes I will commit it.
Comment #13
penyaskitoAs I thought this is not enough, the architectural change was for a good reason. I'll focus on closing all the issues raised in the 8.x-2.x upgrade for getting this fixed.
Comment #14
wendyl CreditAttribution: wendyl commentedWas this error resolved? I see where a patch was attempted to be developed and failed, but that was 2 months ago. Has there been a solution since then?
Comment #15
penyaskito8.x-2.x was already released and it fixes this issue. You probably need to upgrade Lingotek first and then Drupal core.
Let us know if you need any help with this.
Comment #16
rahul patidar CreditAttribution: rahul patidar commentedThanks #penyaskito. Updating lingotek does for me, saved a day.