Fixed Gallery import from Invision undefined index comment_img_id


Well-known member
I tried reimporting without the "Keep IDs" and it worked although I have over 1,500 errors saying:

    ErrorException: [E_NOTICE] Undefined index: comment_img_id src\addons\XFMG\Import\Importer\IpsGallery.php:630

    Generated by: Admin Jan 20, 2020 at 6:31 PM

Stack trace

#0 src\addons\XFMG\Import\Importer\IpsGallery.php(630): XF::handlePhpError(8, '[E_NOTICE] Unde...', 'C:\\xampp\\htdocs...', 630, Array)
#1 src\addons\XFMG\Import\Importer\IpsGallery.php(728): XFMG\Import\Importer\IpsGallery->runStepCommentsForType(Object(XF\Import\StepState), Array, 8, 'xfmg_media')
#2 src\XF\Import\Runner.php(231): XFMG\Import\Importer\IpsGallery->stepMediaComments(Object(XF\Import\StepState), Array, 8)
#3 src\XF\Import\Runner.php(59): XF\Import\Runner->runStep('mediaComments', Object(XF\Import\StepState), 8)
#4 src\XF\Admin\Controller\Import.php(234): XF\Import\Runner->run()
#5 src\XF\Mvc\Dispatcher.php(350): XF\Admin\Controller\Import->actionRun(Object(XF\Mvc\ParameterBag))
#6 src\XF\Mvc\Dispatcher.php(261): XF\Mvc\Dispatcher->dispatchClass('XF:Import', 'Run', Object(XF\Mvc\RouteMatch), Object(XF\Admin\Controller\Import), NULL)
#7 src\XF\Mvc\Dispatcher.php(113): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(XF\Admin\Controller\Import), NULL)
#8 src\XF\Mvc\Dispatcher.php(55): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#9 src\XF\App.php(2184): XF\Mvc\Dispatcher->run()
#10 src\XF.php(391): XF\App->run()
#11 admin.php(13): XF::runApp('XF\\Admin\\App')
#12 {main}

Request state

array(4) {
  ["url"] => string(32) "/recfly_xf2/admin.php?import/run"
  ["referrer"] => string(48) "http://localhost/recfly_xf2/admin.php?import/run"
  ["_GET"] => array(1) {
    ["import/run"] => string(0) ""
  ["_POST"] => array(1) {
    ["_xfToken"] => string(8) "********"

Chris D

XenForo developer
Staff member
This is somewhat confusing because if comment_img_id is missing here then that would be unexpected.

Are you able to run the following query against the IPS database and let me know the output?

SHOW CREATE TABLE gallery_comments

Chris D

XenForo developer
Staff member

I actually need to see the full contents of the Create Table field it has displayed there.

Not sure if PhpMyAdmin let’s you see more but there is a “Copy to clipboard” button below which may just copy the entire text so you can paste it here which would be sufficient.

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.1.7).

Change log:
Prevent undefined index errors when importing gallery comments from IPS Gallery.
There may be a delay before changes are rolled out to the XenForo Community.