Error when deleting all listed orphan / untranslated translation sources

Created on 6 January 2024, about 1 year ago
Updated 8 January 2024, about 1 year ago

I use php 8.1

Problem/Motivation

When I go to /admin/config/regional/l10n_tools and use Delete all listed orphan / untranslated translation sources I get an error and the elements aren't deleted.

Steps to reproduce

Go to /admin/config/regional/l10n_tools and use Delete all listed orphan / untranslated translation sources
You will get this error:

Error message
An error occured, see logs.

The log:
rowCount() is supported for DELETE, INSERT, or UPDATE statements performed with structured query builders only, since they would not be portable across database engines otherwise. If the query builders are not sufficient, use a prepareStatement() with an $allow_row_count argument set to TRUE, execute() the Statement and get the number of matched rows via rowCount().

Thanks a lot

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇪🇸Spain candelas

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @candelas
  • First commit to issue fork.
  • 🇩🇪Germany anruether Bonn

    Not sure if this is another issue, but:

    On my local machine with d10/php8.1 I get this error log SQLSTATE[HY000]: General error: 1 near "ls": syntax error: DELETE ls FROM "locales_source" ls LEFT JOIN "locales_target" lt ON ls.lid=lt.lid WHERE lt.lid IS NULL; Array ( )

    This also happens with the current dev (which seems to be the same as in the branch)

    On my remote php8.2 machine I get an additional message in the UI after clicking:

    Error message
    
        Deprecated function: Creation of dynamic property Drupal\Core\Database\StatementWrapperIterator::$allowRowCount is deprecated in Drupal\l10n_tools\QueryHelper->deleteOrphanTranslations() (line 125 of modules/contrib/l10n_tools/src/QueryHelper.php).
    
        Drupal\l10n_tools\QueryHelper->deleteOrphanTranslations() (Line: 265)
        Drupal\l10n_tools\Form\L10nToolsForm->deleteOrphanTranslationsCallback(Array, Object)
        call_user_func_array(Array, Array) (Line: 114)
        Drupal\Core\Form\FormSubmitter->executeSubmitHandlers(Array, Object) (Line: 52)
        Drupal\Core\Form\FormSubmitter->doSubmitForm(Array, Object) (Line: 597)
        Drupal\Core\Form\FormBuilder->processForm('l10n_tools_form', Array, Object) (Line: 325)
        Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73)
        Drupal\Core\Controller\FormController->getContentResult(Object, Object)
        call_user_func_array(Array, Array) (Line: 123)
        Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 592)
        Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 121)
        Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
        Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 181)
        Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76)
        Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
        Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
        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: 48)
        Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
        Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 51)
        Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 704)
        Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
    
        An error occured, see logs.
    
    
  • 🇩🇪Germany Anybody Porta Westfalica
  • Assigned to Grevil
  • 🇩🇪Germany Anybody Porta Westfalica
Production build 0.71.5 2024