XF 2.2 XFMG Attempt to read property "height" on null

Walter

Well-known member
Found in my error log. XF and XFMG latest versions, PHP 8, Mariadb 10.5. Several occasions, sometimes with height, Data, width, extension, but always XFMG and always the same media. Viewing the media via the direct URL results in a broken picture. The pic was uploaded 2018 with XFMG 1.x

As a resolution I will delete the picture, but maybe the code can be protected.


ErrorException: Template error: [E_WARNING] Attempt to read property "height" on null src/addons/XFMG/Entity/MediaItem.php:997

Code:
#0 src/addons/XFMG/Entity/MediaItem.php(997): XF\Template\Templater->handleTemplateError(2, '[E_WARNING] Att...', '/home/esoterik/...', 997)
#1 src/XF/Mvc/Entity/Entity.php(160): XFMG\Entity\MediaItem->getStructuredData()
#2 src/XF/Mvc/Entity/Entity.php(118): XF\Mvc\Entity\Entity->get('structured_data')
#3 internal_data/code_cache/templates/l2/s3/public/xfmg_media_view.php(43): XF\Mvc\Entity\Entity->offsetGet('structured_data')
#4 src/XF/Template/Templater.php(1651): XF\Template\Templater->{closure}(Object(SV\StandardLib\XF\Template\Templater), Array, NULL)
#5 src/XF/Template/Template.php(24): XF\Template\Templater->renderTemplate('xfmg_media_view', Array)
#6 src/XF/Mvc/Renderer/Html.php(50): XF\Template\Template->render()
#7 src/XF/Mvc/Dispatcher.php(460): XF\Mvc\Renderer\Html->renderView('XFMG:Media\\View', 'public:xfmg_med...', Array)
#8 src/XF/Mvc/Dispatcher.php(442): XF\Mvc\Dispatcher->renderView(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#9 src/XF/Mvc/Dispatcher.php(402): XF\Mvc\Dispatcher->renderReply(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#10 src/XF/Mvc/Dispatcher.php(60): XF\Mvc\Dispatcher->render(Object(XF\Mvc\Reply\View), 'html')
#11 src/XF/App.php(2351): XF\Mvc\Dispatcher->run()
#12 src/XF.php(517): XF\App->run()
#13 index.php(20): XF::runApp('XF\\Pub\\App')
#14 {main}

array(4) {
  ["url"] => string(28) "/media/20180428_120322.8188/"
  ["referrer"] => bool(false)
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(0) {
  }
}
 

Ivancas

Active member
Found in my error log. XF and XFMG latest versions, PHP 8, Mariadb 10.5. Several occasions, sometimes with height, Data, width, extension, but always XFMG and always the same media. Viewing the media via the direct URL results in a broken picture. The pic was uploaded 2018 with XFMG 1.x

As a resolution I will delete the picture, but maybe the code can be protected.


ErrorException: Template error: [E_WARNING] Attempt to read property "height" on null src/addons/XFMG/Entity/MediaItem.php:997

Code:
#0 src/addons/XFMG/Entity/MediaItem.php(997): XF\Template\Templater->handleTemplateError(2, '[E_WARNING] Att...', '/home/esoterik/...', 997)
#1 src/XF/Mvc/Entity/Entity.php(160): XFMG\Entity\MediaItem->getStructuredData()
#2 src/XF/Mvc/Entity/Entity.php(118): XF\Mvc\Entity\Entity->get('structured_data')
#3 internal_data/code_cache/templates/l2/s3/public/xfmg_media_view.php(43): XF\Mvc\Entity\Entity->offsetGet('structured_data')
#4 src/XF/Template/Templater.php(1651): XF\Template\Templater->{closure}(Object(SV\StandardLib\XF\Template\Templater), Array, NULL)
#5 src/XF/Template/Template.php(24): XF\Template\Templater->renderTemplate('xfmg_media_view', Array)
#6 src/XF/Mvc/Renderer/Html.php(50): XF\Template\Template->render()
#7 src/XF/Mvc/Dispatcher.php(460): XF\Mvc\Renderer\Html->renderView('XFMG:Media\\View', 'public:xfmg_med...', Array)
#8 src/XF/Mvc/Dispatcher.php(442): XF\Mvc\Dispatcher->renderView(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#9 src/XF/Mvc/Dispatcher.php(402): XF\Mvc\Dispatcher->renderReply(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#10 src/XF/Mvc/Dispatcher.php(60): XF\Mvc\Dispatcher->render(Object(XF\Mvc\Reply\View), 'html')
#11 src/XF/App.php(2351): XF\Mvc\Dispatcher->run()
#12 src/XF.php(517): XF\App->run()
#13 index.php(20): XF::runApp('XF\\Pub\\App')
#14 {main}

array(4) {
  ["url"] => string(28) "/media/20180428_120322.8188/"
  ["referrer"] => bool(false)
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(0) {
  }
}
I second this and it should be marked as a bug
 
Last edited:
Top