- @rp7 opened merge request.
- 🇧🇪Belgium rp7
Merged 2.0.x into the branch.
Since I couldn't change the target branch to 2.0.x, I created a new merge request (https://git.drupalcode.org/project/linkchecker/-/merge_requests/113).
Similar to 🐛 Entity IDs can be strings in Drupal 8 Needs work and documented in 📌 Convert the entity_legal_document_version entity ID from string to serial Fixed Link checker throws an exception when an entity has a string ID, which is rare but allowed in Drupal 8. See also #3057609: Add content moderation support for content entities with string IDs → and #2555027: Support non-numeric entity ID's → .
Steps to reproduce
1. Have a D9 project.
2. composer require drupal/linkchecker composer require 'drupal/entity_legal:3.0.x-dev@dev'
3. Apply Entity Legal patch from
#3182420-5: non-existent service path.alias_storage →
.
4. Enable Link checker and Entity Legal.
4. Create a legal document version entity, get the following exception:
The website encountered an unexpected error. Please try again later.
Drupal\Core\Entity\EntityStorageException: SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect integer value: 'foobar_1615306631' for column `db`.`linkchecker_index`.`entity_id` at row 1: INSERT INTO {linkchecker_index} ("entity_id", "entity_type", "last_extracted_time") VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2); Array ( [:db_insert_placeholder_0] => foobar_1615306631 [:db_insert_placeholder_1] => entity_legal_document_version [:db_insert_placeholder_2] => 1615306643 ) in Drupal\Core\Entity\Sql\SqlContentEntityStorage->save() (line 810 of core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php).
Drupal\Core\Database\StatementWrapper->execute(Array, Array) (Line: 823)
Drupal\Core\Database\Connection->query('INSERT INTO {linkchecker_index} ("entity_id", "entity_type", "last_extracted_time") VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2)', Array, Array) (Line: 97)
Drupal\Core\Database\Driver\mysql\Connection->query('INSERT INTO {linkchecker_index} ("entity_id", "entity_type", "last_extracted_time") VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2)', Array, Array) (Line: 32)
Drupal\Core\Database\Driver\mysql\Insert->execute() (Line: 390)
Drupal\linkchecker\LinkExtractorService->updateEntityExtractIndex(Object) (Line: 158)
linkchecker_entity_insert(Object)
call_user_func_array('linkchecker_entity_insert', Array) (Line: 403)
Drupal\Core\Extension\ModuleHandler->invokeAll('entity_insert', Array) (Line: 201)
Drupal\Core\Entity\EntityStorageBase->invokeHook('insert', Object) (Line: 800)
Drupal\Core\Entity\ContentEntityStorageBase->invokeHook('insert', Object) (Line: 530)
Drupal\Core\Entity\EntityStorageBase->doPostSave(Object, ) (Line: 685)
Drupal\Core\Entity\ContentEntityStorageBase->doPostSave(Object, ) (Line: 455)
Drupal\Core\Entity\EntityStorageBase->save(Object) (Line: 801)
Drupal\Core\Entity\Sql\SqlContentEntityStorage->save(Object) (Line: 339)
Drupal\Core\Entity\EntityBase->save() (Line: 116)
Drupal\entity_legal\Form\EntityLegalDocumentVersionForm->save(Array, Object)
call_user_func_array(Array, Array) (Line: 113)
Drupal\Core\Form\FormSubmitter->executeSubmitHandlers(Array, Object) (Line: 51)
Drupal\Core\Form\FormSubmitter->doSubmitForm(Array, Object) (Line: 593)
Drupal\Core\Form\FormBuilder->processForm('entity_legal_document_version_foobar_form', Array, Object) (Line: 321)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 48)
Drupal\Core\Entity\EntityFormBuilder->getForm(Object) (Line: 129)
Drupal\entity_legal\Controller\EntityLegalController->documentVersionForm(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 573)
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}() (Line: 158)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 80)
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: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 52)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 706)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
Needs review
1.0
Code
Issue summaries save everyone time if they are kept up-to-date. See Update issue summary task instructions.
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
Merged 2.0.x into the branch.
Since I couldn't change the target branch to 2.0.x, I created a new merge request (https://git.drupalcode.org/project/linkchecker/-/merge_requests/113).