Fixed XFMG 2.0 RC1

Affected version
2.0 rc1

Active member
After upgrading:

InvalidArgumentException: Unknown moderator handler type 'xfmg_media' in src/XF/ModeratorLog/Logger.php at line 183
XF\ModeratorLog\Logger->handler() in src/XF/ModeratorLog/Logger.php at line 20
XF\ModeratorLog\Logger->logChanges() in src/XF/Logger.php at line 47
XF\Logger->logModeratorChanges() in src/addons/XFMG/Entity/MediaItem.php at line 1005
XFMG\Entity\MediaItem->_postSave() in src/XF/Mvc/Entity/Entity.php at line 1109
XF\Mvc\Entity\Entity->save() in src/addons/XFMG/Setup.php at line 2226
XFMG\Setup->upgrade902000038Step3() in src/XF/AddOn/StepRunnerUpgradeTrait.php at line 117
XFMG\Setup->upgradeStepRunner() in src/XF/AddOn/StepRunnerUpgradeTrait.php at line 74
XFMG\Setup->upgrade() in src/XF/Admin/Controller/AddOn.php at line 433
XF\Admin\Controller\AddOn->actionUpgrade() in src/XF/Mvc/Dispatcher.php at line 249
XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 88
XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 41
XF\Mvc\Dispatcher->run() in src/XF/App.php at line 1852
XF\App->run() in src/XF.php at line 328
XF::runApp() in admin.php at line 13

Chris D

XenForo developer
Staff member
Did the upgrade otherwise complete successfully?

There's no need to uninstall old add-ons.

Chris D

XenForo developer
Staff member
This is fixed for the next release. To fix it now and get through the upgrade (if it was indeed prevented) then open the file src/addons/XFMG/Setup.php and find:
$album = $this->app->em()->find('XFMG:Album', $albumId);
And below that add:
$album->setOption('log_moderator', false);
Then find:
$mediaItem = $this->app->em()->find('XFMG:MediaItem', $mediaId);
And below that add:
$mediaItem->setOption('log_moderator', false);