MG 2.0 Many errors after rebuilding cache


Well-known member
I was looking through my Media section on my site and decided to do a rebuild of the cache's after a recent upgrade to XF v2. The result was thousands of server errors like this one.

Server error log

    ErrorException: [E_NOTICE] Trying to get property of non-object src/addons/XFMG/Entity/MediaItem.php:432

    Generated by: Admin Mar 9, 2018 at 10:22 AM

Stack trace

#0 src/addons/XFMG/Entity/MediaItem.php(432): XF::handlePhpError(8, '[E_NOTICE] Tryi...', '/home/rfcom/pub...', 432, Array)
#1 src/addons/XFMG/Entity/MediaItem.php(427): XFMG\Entity\MediaItem->_canAddRemoveWatermark(true, NULL)
#2 src/addons/XFMG/InlineMod/Media/RemoveWatermark.php(19): XFMG\Entity\MediaItem->canRemoveWatermark(true, NULL)
#3 src/XF/InlineMod/AbstractAction.php(68): XFMG\InlineMod\Media\RemoveWatermark->canApplyToEntity(Object(SV\ContentRatingsXFMG\XFMG\Entity\MediaItem), Array, NULL)
#4 src/XF/InlineMod/AbstractAction.php(57): XF\InlineMod\AbstractAction->canApplyInternal(Object(XF\Mvc\Entity\ArrayCollection), Array, NULL)
#5 src/XF/Pub/Controller/InlineMod.php(42): XF\InlineMod\AbstractAction->canApply(Object(XF\Mvc\Entity\ArrayCollection))
#6 src/XF/Mvc/Dispatcher.php(249): XF\Pub\Controller\InlineMod->actionShowActions(Object(XF\Mvc\ParameterBag))
#7 src/XF/Mvc/Dispatcher.php(88): XF\Mvc\Dispatcher->dispatchClass('XF:InlineMod', 'ShowActions', 'json', Object(XF\Mvc\ParameterBag), '', Object(XF\Pub\Controller\InlineMod), Object(XF\Mvc\Reply\Reroute))
#8 src/XF/Mvc/Dispatcher.php(41): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#9 src/XF/App.php(1889): XF\Mvc\Dispatcher->run()
#10 src/XF.php(328): XF\App->run()
#11 index.php(13): XF::runApp('XF\\Pub\\App')
#12 {main}

Request state

array(4) {
  ["url"] => string(174) "/inline-mod/?type=xfmg_media&_xfRequestUri=%2Fmedia%2Fusers%2Fgandalph.6024%2Fpage-6&_xfWithData=1&_xfToken=1520551338%2Cc46c03f5e26119957c63639ee765c99f&_xfResponseType=json"
  ["referrer"] => string(67) ""
  ["_GET"] => array(5) {
    ["type"] => string(10) "xfmg_media"
    ["_xfRequestUri"] => string(33) "/media/users/gandalph.6024/page-6"
    ["_xfWithData"] => string(1) "1"
    ["_xfToken"] => string(43) "1520551338,c46c03f5e26119957c63639ee765c99f"
    ["_xfResponseType"] => string(4) "json"
  ["_POST"] => array(0) {
Any ideas why?

Chris D

XenForo developer
Staff member
That error doesn’t look to be caused by a rebuild. It looks like it happened when trying to use inline mod. In fact, it looks like it’s possible it happened when you selected one of those images that has gone missing. Maybe that will help you reproduce it to confirm.

Were there any there errors aside from the ones you mentioned in the other threads?


Well-known member
Sorry Chris, I should have combined the threads seeing your fix in the other thread with the config file addition fixed these...sorry to have bothered you.