Problem/Motivation
When trying to generate a dump, I get the error
[error] Error: Call to undefined method Drupal\mysql\Driver\Database\mysql\Connection::transactionManager() in Drupal\gdpr_dump\Service\GdprSqlDump->cleanup() (line 348 of /var/www/html/web/modules/contrib/gdpr/modules/gdpr_dump/src/Service/GdprSqlDump.php) #0 /var/www/html/web/modules/contrib/gdpr/modules/gdpr_dump/src/Service/GdprSqlDump.php(317): Drupal\gdpr_dump\Service\GdprSqlDump->cleanup()
Steps to reproduce
Drupal 9.5.11, php 8.1.18
run
drush gdpr-sql-dump --result-file=sites/default/files/dumps/240729-userdata_anonymisation.sql
Proposed resolution
gdpr/modules/gdpr_dump/src/Service/GdprSqlDump.php l 216 and 348
Use
if (method_exists($this->database, 'transactionManager')) {
$this->database->transactionManager()->unpile($transaction->name());
}
else {
// @phpstan-ignore-next-line to handle backward compatibility.
$this->database->popTransaction($transaction->name());
}
instead of
if ($this->database->transactionManager()) {
$this->database->transactionManager()->unpile($transaction->name());
}
else {
// @phpstan-ignore-next-line to handle backward compatibility.
$this->database->popTransaction($transaction->name());
}
Remaining tasks
User interface changes
API changes
Data model changes
Comments
Comment #8
abelassHere is the patch
Comment #9
abelassComment #11
ankitv18 commentedPlease review and validate the MR!46
Comment #13
rajeshreeputraComment #15
tommyk commentedI reverted to the fix commit from 3.1.0 and it's not fixed.
Error: Call to undefined method Drupal\Core\Database\Transaction::id() in Drupal\gdpr_dump\Service\GdprSqlDump->cleanup() (line 349 of /var/www/html/web/modules/contrib/gdpr/modules/gdpr_dump/src/Service/GdprSqlDump.php).Comment #16
rajeshreeputra@TommyK, thanks for your input, will check with 3.0.1 and 3.0.x branch, again!
Comment #17
rajeshreeputraComment #18
ankitv18 commentedI've logged a issue in drupal core to retrieve the transaction id: https://www.drupal.org/project/drupal/issues/3466569#comment-15717284
Comment #20
ankitv18 commentedAs per suggestion on https://www.drupal.org/project/drupal/issues/3466569
I've raised a new MR
Comment #22
ankitv18 commentedWith new MR!49

Before unsetting transaction
After unsetting transaction

Comment #24
rajeshreeputraMerged.
Comment #25
rajeshreeputra