Fixed PhotoPost Pro Importer: Exception if comment is empty

Affected version
2.2.2

Kirby

Well-known member
Code:
LogicException: Column 'message' is required and has an empty value while importing XFMG:Comment with id = 8
src/XF/Import/Data/EntityEmulator.php:282
Generated by: Unknown account Jun 14, 2021 at 11:56 AM

#0 src/XF/Import/Data/EntityEmulator.php(326): XF\Import\Data\EntityEmulator->getWriteData()
#1 src/XF/Import/Data/AbstractEmulatedData.php(71): XF\Import\Data\EntityEmulator->insert(8, Object(XF\Db\Mysqli\Adapter))
#2 src/XF/Import/Data/AbstractData.php(127): XF\Import\Data\AbstractEmulatedData->write(8)
#3 src/addons/XFMG/Import/Importer/PhotopostPro.php(772): XF\Import\Data\AbstractData->save(8)
#4 src/XF/Import/Runner.php(242): XFMG\Import\Importer\PhotopostPro->stepComments(Object(XF\Import\StepState), Array, 8)
#5 src/XF/Import/Runner.php(59): XF\Import\Runner->runStep('comments', Object(XF\Import\StepState), 8)
#6 src/XF/Import/Runner.php(152): XF\Import\Runner->run()
#7 src/XF/Import/Runner.php(128): XF\Import\Runner->runUntilCompleteInternal(Object(XF\Import\Manager), Object(Closure))
#8 src/XF/Cli/Command/Import.php(155): XF\Import\Runner->runUntilComplete(Object(XF\Import\Manager), Object(Closure))
#9 src/vendor/symfony/console/Command/Command.php(255): XF\Cli\Command\Import->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#10 src/vendor/symfony/console/Application.php(992): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#11 src/vendor/symfony/console/Application.php(255): Symfony\Component\Console\Application->doRunCommand(Object(XF\Cli\Command\Import), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#12 src/vendor/symfony/console/Application.php(148): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#13 src/XF/Cli/Runner.php(109): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#14 cmd.php(15): XF\Cli\Runner->run()
#15 {main}

Adding a check if $comment['comment'] is not empty seems to fix this.
 

XF Bug Bot

XenForo bug fixer bot
Staff member
Thank you for reporting this issue, it has now been resolved. We are aiming to include any changes that have been made in a future XFMG release (2.2.3).

Change log:
Skip importing media comments where the message is empty.
There may be a delay before changes are rolled out to the XenForo Community.
 
Top