Drupal 9 requires Drush 10 but the gdpr_dump module is holding quite a few functions which got removed from Drush 10.

CommentFileSizeAuthor
#8 gdpr-3155980-8.patch1.63 KBvishalkhode
#2 3155980_2.patch9.94 KBleymannx

Comments

leymannx created an issue. See original summary.

leymannx’s picture

Status: Active » Needs work
StatusFileSize
new9.94 KB

Attaching a patch as first attempt. But I didn't got it working. When dumping a file it's empty. And when trying to sanitize it gives me an Call to a member function log() on null in Drupal\gdpr_dump\Sql\GdprSqlMysql->dump() error.

mhavelant’s picture

Status: Needs work » Needs review

I went through the code and fixed the command not working, fixed deprecations, did some cleanup, too.

See commit 38cba49.

mhavelant’s picture

Note, I tested it with the latest version of both Drush 9 and 10 and seems to be working as expected.

mhavelant’s picture

Also due to https://github.com/drush-ops/drush/pull/4129 I'm deprecating these classes so they can be removed later.

alexdmccabe’s picture

Version: 8.x-2.x-dev » 3.0.x-dev
alexdmccabe’s picture

Status: Needs review » Needs work

The patch doesn't apply so it needs to be rebased, but is this issue even still an issue?

vishalkhode’s picture

StatusFileSize
new1.63 KB

I've verified. Most of the changes from #2 patch is already being added. While there was some changes missing. which I've added it.
Also, I was getting below error when running command: `drush gdpr:sanitize` which also I've fixed it.

user@MacBookPro-VishalKhode gdpr % drush gdpr:sanitize
[error]  Error: Call to a member function getExpandedTableSelection() on null in Drupal\gdpr_dump\Service\GdprSqlDump->buildTablesToSkip() (line 322 of ~/project/drupal9/web/modules/contrib/gdpr/modules/gdpr_dump/src/Service/GdprSqlDump.php) #0 ~/project/drupal9/web/modules/contrib/gdpr/modules/gdpr_dump/src/Service/GdprSqlDump.php(312): Drupal\gdpr_dump\Service\GdprSqlDump->buildTablesToSkip()
#1 ~/project/drupal9/web/modules/contrib/gdpr/modules/gdpr_dump/src/Service/GdprSanitize.php(21): Drupal\gdpr_dump\Service\GdprSqlDump->prepare()
#2 ~/project/drupal9/web/modules/contrib/gdpr/modules/gdpr_dump/src/Commands/GdprDumpCommands.php(116): Drupal\gdpr_dump\Service\GdprSanitize->sanitize()
#3 [internal function]: Drupal\gdpr_dump\Commands\GdprDumpCommands->sanitize(Array)
#4 ~/project/drupal9/vendor/consolidation/annotated-command/src/CommandProcessor.php(257): call_user_func_array(Array, Array)
#5 ~/project/drupal9/vendor/consolidation/annotated-command/src/CommandProcessor.php(212): Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback(Array, Object(Consolidation\AnnotatedCommand\CommandData))
#6 ~/project/drupal9/vendor/consolidation/annotated-command/src/CommandProcessor.php(176): Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter(Array, Array, Object(Consolidation\AnnotatedCommand\CommandData))
#7 ~/project/drupal9/vendor/consolidation/annotated-command/src/AnnotatedCommand.php(311): Consolidation\AnnotatedCommand\CommandProcessor->process(Object(Symfony\Component\Console\Output\ConsoleOutput), Array, Array, Object(Consolidation\AnnotatedCommand\CommandData))
#8 ~/project/drupal9/vendor/symfony/console/Command/Command.php(255): Consolidation\AnnotatedCommand\AnnotatedCommand->execute(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#9 ~/project/drupal9/vendor/symfony/console/Application.php(1027): Symfony\Component\Console\Command\Command->run(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#10 ~/project/drupal9/vendor/symfony/console/Application.php(273): Symfony\Component\Console\Application->doRunCommand(Object(Consolidation\AnnotatedCommand\AnnotatedCommand), Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#11 ~/project/drupal9/vendor/symfony/console/Application.php(149): Symfony\Component\Console\Application->doRun(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#12 ~/project/drupal9/vendor/drush/drush/src/Runtime/Runtime.php(118): Symfony\Component\Console\Application->run(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#13 ~/project/drupal9/vendor/drush/drush/src/Runtime/Runtime.php(48): Drush\Runtime\Runtime->doRun(Array, Object(Symfony\Component\Console\Output\ConsoleOutput))
#14 ~/project/drupal9/vendor/drush/drush/drush.php(72): Drush\Runtime\Runtime->run(Array)
#15 ~/project/drupal9/vendor/drush/drush/drush(4): require('~/project/d...')
#16 {main}.
Error: Call to a member function getExpandedTableSelection() on null in ~/project/drupal9/web/modules/contrib/gdpr/modules/gdpr_dump/src/Service/GdprSqlDump.php on line 322 #0 ~/project/drupal9/web/modules/contrib/gdpr/modules/gdpr_dump/src/Service/GdprSqlDump.php(312): Drupal\gdpr_dump\Service\GdprSqlDump->buildTablesToSkip()
#1 ~/project/drupal9/web/modules/contrib/gdpr/modules/gdpr_dump/src/Service/GdprSanitize.php(21): Drupal\gdpr_dump\Service\GdprSqlDump->prepare()
#2 ~/project/drupal9/web/modules/contrib/gdpr/modules/gdpr_dump/src/Commands/GdprDumpCommands.php(116): Drupal\gdpr_dump\Service\GdprSanitize->sanitize()
#3 [internal function]: Drupal\gdpr_dump\Commands\GdprDumpCommands->sanitize(Array)
#4 ~/project/drupal9/vendor/consolidation/annotated-command/src/CommandProcessor.php(257): call_user_func_array(Array, Array)
#5 ~/project/drupal9/vendor/consolidation/annotated-command/src/CommandProcessor.php(212): Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback(Array, Object(Consolidation\AnnotatedCommand\CommandData))
#6 ~/project/drupal9/vendor/consolidation/annotated-command/src/CommandProcessor.php(176): Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter(Array, Array, Object(Consolidation\AnnotatedCommand\CommandData))
#7 ~/project/drupal9/vendor/consolidation/annotated-command/src/AnnotatedCommand.php(311): Consolidation\AnnotatedCommand\CommandProcessor->process(Object(Symfony\Component\Console\Output\ConsoleOutput), Array, Array, Object(Consolidation\AnnotatedCommand\CommandData))
#8 ~/project/drupal9/vendor/symfony/console/Command/Command.php(255): Consolidation\AnnotatedCommand\AnnotatedCommand->execute(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#9 ~/project/drupal9/vendor/symfony/console/Application.php(1027): Symfony\Component\Console\Command\Command->run(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#10 ~/project/drupal9/vendor/symfony/console/Application.php(273): Symfony\Component\Console\Application->doRunCommand(Object(Consolidation\AnnotatedCommand\AnnotatedCommand), Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#11 ~/project/drupal9/vendor/symfony/console/Application.php(149): Symfony\Component\Console\Application->doRun(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#12 ~/project/drupal9/vendor/drush/drush/src/Runtime/Runtime.php(118): Symfony\Component\Console\Application->run(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#13 ~/project/drupal9/vendor/drush/drush/src/Runtime/Runtime.php(48): Drush\Runtime\Runtime->doRun(Array, Object(Symfony\Component\Console\Output\ConsoleOutput))
#14 ~/project/drupal9/vendor/drush/drush/drush.php(72): Drush\Runtime\Runtime->run(Array)
#15 ~/project/drupal9/vendor/drush/drush/drush(4): require('~/project/...')
#16 {main}
Error: Call to a member function getExpandedTableSelection() on null in Drupal\gdpr_dump\Service\GdprSqlDump->buildTablesToSkip() (line 322 of ~/project/drupal9/web/modules/contrib/gdpr/modules/gdpr_dump/src/Service/GdprSqlDump.php).
[warning] Drush command terminated abnormally.
vishalkhode’s picture

Status: Needs work » Needs review

Moving this to review.

alexdmccabe’s picture

Status: Needs review » Fixed

Thanks everyone!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.