Fixed Media rebuild error message


Formerly ftsservice
The latest version of XF 2.1, used with the latest XF Media.

I get this during the rebuilding process after an import from VB 5.2.1 and Photopost Pro.
Fatal error: Cannot use XFMG\Entity\MediaItem as MediaItem because the name is already in use in public_html/forum/xf/src/addons/XFMG/Job/MediaRatingRebuild.php on line 6

The forum has about 100K posts, about 32K images in the gallery.

Chris D

XenForo developer
Staff member
This is probably a bug, but you can sort that by editing src/addons/XFMG/Job/MediaRatingRebuild.php.

Find and remove this from line 6:
use XFMG\Entity\MediaItem;


Formerly ftsservice
Thanks. Will do that. I had thought about trying that so it wouldn't be declared twice during execution, but I wasn't sure if it wasn't going to break anything since I'm not familiar with the core code in the Media Gallery.

XF Bug Bot

XenForo bug fixer bot
Staff member
Thank you for reporting this issue. It has now been resolved and we are aiming to include it in a future XFMG release (2.1.2).

Change log:
Prevent error when rebuilding media item ratings due to a conflicting class alias.
Any changes made as a result of this issue being resolved may not be rolled out here until later.