• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Fixed InvalidArgumentException: Accessed unknown getter 'media_id' on XFMG:Album[1] src/XF/Mvc/Entity/Entity.php:179

Affected version
2.0.0. Beta 7

Neal

Well-known member
#1
I realised some of my albums assigned to categories had the privacy set to album owner only. If viewing the site as a guest, images in these private albums were not showing on the forum home page. Viewing the media gallery as a guest however I can see these albums and the media within.

With some albums I can't change the privacy, I can only edit the title and description. Other albums I can change the privacy, etc.

Example of a private album viewable by anyone - https://talkgeek.net/media/albums/xbox-one-s-gaming.2/

I've also noticed quite a few of the below error in the admin panel after fiddling about trying to move albums around the different categories to see if it would solve the issue above but it did not work:

Code:
Server error log

InvalidArgumentException: Accessed unknown getter 'media_id' on XFMG:Album[1] src/XF/Mvc/Entity/Entity.php:179
Generated by: Brunlea 19 October 2017 at 22:30

Stack trace

#0 src/XF/Mvc/Entity/Entity.php(97): XF\Mvc\Entity\Entity->get('media_id')
#1 internal_data/code_cache/templates/l1/s0/admin/xfmg_base_batch_update_list.php(135): XF\Mvc\Entity\Entity->offsetGet('media_id')
#2 src/XF/Template/Templater.php(1167): XF\Template\Templater->{closure}(Object(XF\Template\Templater), Array)
#3 src/XF/Template/Templater.php(1241): XF\Template\Templater->renderTemplate('xfmg_base_batch...', Array)
#4 internal_data/code_cache/templates/l1/s0/admin/xfmg_batch_update_albums_list.php(12): XF\Template\Templater->includeTemplate('admin:xfmg_base...', Array)
#5 src/XF/Template/Templater.php(1167): XF\Template\Templater->{closure}(Object(XF\Template\Templater), Array)
#6 src/XF/Template/Template.php(24): XF\Template\Templater->renderTemplate('xfmg_batch_upda...', Array)
#7 src/XF/Mvc/Renderer/Html.php(48): XF\Template\Template->render()
#8 src/XF/Mvc/Dispatcher.php(332): XF\Mvc\Renderer\Html->renderView('XFMG:Album\\Batc...', 'admin:xfmg_batc...', Array)
#9 src/XF/Mvc/Dispatcher.php(303): XF\Mvc\Dispatcher->renderView(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#10 src/XF/Mvc/Dispatcher.php(44): XF\Mvc\Dispatcher->render(Object(XF\Mvc\Reply\View), 'html')
#11 src/XF/App.php(1844): XF\Mvc\Dispatcher->run()
#12 src/XF.php(328): XF\App->run()
#13 admin.php(13): XF::runApp('XF\\Admin\\App')
#14 {main}

Request state

array(4) {
  ["url"] => string(55) "/admin.php?media-gallery/batch-update/albums/list&all=1"
  ["referrer"] => string(72) "https://talkgeek.net/admin.php?media-gallery/batch-update/albums/confirm"
  ["_GET"] => array(2) {
    ["media-gallery/batch-update/albums/list"] => string(0) ""
    ["all"] => string(1) "1"
  }
  ["_POST"] => array(0) {
  }
}