- 🇨🇴Colombia Nestor_Fabian
Patch error getTermIdsWithPendingRevisions in drupal upgrade error 8 a 9
Hi,
I'm a first-time poster here, so apologies in advance if I've missed anything.
I've updated to 8.7.2 and ran into a database issue whilst running /update.php
Taxonomy module
Update make_taxonomy_term_revisionable
Failed: Drupal\Core\Entity\EntityStorageException: The entity update process failed while processing the entity type taxonomy_term, ID: 9. in Drupal\Core\Entity\Sql\SqlContentEntityStorageSchema->copyData() (line 216 of /var/www/html/core/lib/Drupal/Core/Entity/Sql/SqlFieldableEntityTypeListenerTrait.php)
Status report:
Mismatched entity and/or field definitions
The following changes were detected in the entity type and field definitions.
Taxonomy term
The Taxonomy term entity type needs to be updated.
- The Revision ID field needs to be installed.
- The Revision create time field needs to be installed.
- The Revision user field needs to be installed.
- The Revision log message field needs to be installed.
- The Default revision field needs to be installed.
- The Revision translation affected field needs to be installed.
As it is an unused taxonomy, I deleted all the rows that had a reference to it in all taxonomy_term_* tables.
Running update.php still shows the same issue, as if taxonomy_term id=9 was still in the database.
When trying to list the taxonomy terms /admin/structure/taxonomy, I get the following error message:
The website encountered an unexpected error. Please try again later.</br></br><em class="placeholder">Drupal\Core\Database\DatabaseExceptionWrapper</em>: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ') AS expression
FROM
tfr
INNER JOIN tr ON tfr. = tr. AND tr. = 0
INNER JOIN (S' at line 1: SELECT tfr.tid AS tid, MAX(tfr.) AS expression
FROM
{} tfr
INNER JOIN {} tr ON tfr. = tr. AND tr. = 0
INNER JOIN (SELECT t.tid AS tid, t.langcode AS langcode, MAX(t.) AS expression
FROM
{} t
WHERE t. = :db_condition_placeholder_0
GROUP BY t.tid, t.langcode) mr ON tfr. = mr. AND tfr.langcode = mr.langcode
GROUP BY tfr.tid; Array
(
[:db_condition_placeholder_0] => 1
)
in <em class="placeholder">Drupal\taxonomy\TermStorage->getTermIdsWithPendingRevisions()</em> (line <em class="placeholder">404</em> of <em class="placeholder">core/modules/taxonomy/src/TermStorage.php</em>). <pre class="backtrace">Drupal\Core\Database\Statement->execute(Array, Array) (Line: 631)
Drupal\Core\Database\Connection->query('SELECT tfr.tid AS tid, MAX(tfr.) AS expression
FROM
{} tfr
INNER JOIN {} tr ON tfr. = tr. AND tr. = 0
INNER JOIN (SELECT t.tid AS tid, t.langcode AS langcode, MAX(t.) AS expression
FROM
{} t
WHERE t. = :db_condition_placeholder_0
GROUP BY t.tid, t.langcode) mr ON tfr. = mr. AND tfr.langcode = mr.langcode
GROUP BY tfr.tid', Array, Array) (Line: 358)
Drupal\Core\Database\Driver\mysql\Connection->query('SELECT tfr.tid AS tid, MAX(tfr.) AS expression
FROM
{} tfr
INNER JOIN {} tr ON tfr. = tr. AND tr. = 0
INNER JOIN (SELECT t.tid AS tid, t.langcode AS langcode, MAX(t.) AS expression
FROM
{} t
WHERE t. = :db_condition_placeholder_0
GROUP BY t.tid, t.langcode) mr ON tfr. = mr. AND tfr.langcode = mr.langcode
GROUP BY tfr.tid', Array, Array) (Line: 510)
Drupal\Core\Database\Query\Select->execute() (Line: 404)
Drupal\taxonomy\TermStorage->getTermIdsWithPendingRevisions() (Line: 291)
Drupal\taxonomy\Form\OverviewTerms->buildForm(Array, Object, Object)
call_user_func_array(Array, Array) (Line: 519)
Drupal\Core\Form\FormBuilder->retrieveForm('taxonomy_overview_terms', Object) (Line: 276)
Drupal\Core\Form\FormBuilder->buildForm('taxonomy_overview_terms', Object) (Line: 93)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 582)
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: 151)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 68)
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: 693)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
</pre>
I cleared the Drupal cache, browser cache, tried on a different browser.
Webserver: Centos7, Database: 5.5.5-10.1.32-MariaDB, PHP 7.1.17
Have I missed any step?
Many thanks in advance
Fixed
8.7 ⚰️
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
Patch error getTermIdsWithPendingRevisions in drupal upgrade error 8 a 9