What's new
Xen Factory

Register today to become a member! Once signed in, you'll be able to start purchasing our products, ask questions, request support and suggest new ideas!

  • We are aware that a no permission error was shown when you tried to purchase in the last 2 days, this is now fixed.

Bug Resolved Errors after fresh install at XF 2.2.x

ottoZF

New Member
Hello,
I have some error messages after a clean new install:
1681291449863.png


Code:
ErrorException: Template error: [E_WARNING] Attempt to read property "xfa_motm" on null src/addons/XFA/XFMGMediaOfTheMonth/XFMG/Entity/MediaItem.php:50
Generiert durch: Hägar181 12.04.2023 um 11:13 Uhr

Code:
#0 src/addons/XFA/XFMGMediaOfTheMonth/XFMG/Entity/MediaItem.php(50): XF\Template\Templater->handleTemplateError(2, '[E_WARNING] Att...', '/var/www/vhosts...', 50)
#1 src/XF/Template/Templater.php(1191): XFA\XFMGMediaOfTheMonth\XFMG\Entity\MediaItem->canVoteMotm()
#2 internal_data/code_cache/templates/l2/s1/public/xfa_mgmotm_vote_button.php(10): XF\Template\Templater->method(Object(SV\CustomFieldPerms\XFMG\Entity\MediaItem), 'canVoteMotm', Array)
#3 src/XF/Template/Templater.php(1651): XF\Template\Templater->{closure}(Object(X0815\ChkTables\XF\Template\Templater), Array, NULL)
#4 src/addons/MaZ/AMP/Traits/Templater/XF22.php(52): XF\Template\Templater->renderTemplate('xfa_mgmotm_vote...', Array, true, NULL)
#5 src/addons/MaZ/AUN/XF/Template/Templater.php(39): MaZ\AMP\XF\Template\Templater->renderTemplate('public:xfa_mgmo...', Array, true, NULL)
#6 src/XF/Template/Templater.php(1680): MaZ\AUN\XF\Template\Templater->renderTemplate('public:xfa_mgmo...', Array)
#7 internal_data/code_cache/templates/l2/s1/public/xfmg_media_lightbox_sidebar.php(280): XF\Template\Templater->includeTemplate('public:xfa_mgmo...', Array)
#8 src/XF/Template/Templater.php(1651): XF\Template\Templater->{closure}(Object(X0815\ChkTables\XF\Template\Templater), Array, NULL)
#9 src/addons/MaZ/AMP/Traits/Templater/XF22.php(52): XF\Template\Templater->renderTemplate('xfmg_media_ligh...', Array, true, NULL)
#10 src/addons/MaZ/AUN/XF/Template/Templater.php(39): MaZ\AMP\XF\Template\Templater->renderTemplate('public:xfmg_med...', Array, true, NULL)
#11 src/XF/Template/Template.php(24): MaZ\AUN\XF\Template\Templater->renderTemplate('public:xfmg_med...', Array)
#12 src/XF/Mvc/Renderer/Json.php(86): XF\Template\Template->render()
#13 src/XF/Mvc/Renderer/Json.php(70): XF\Mvc\Renderer\Json->renderHtmlFallback('XFMG:Media\\Ligh...', 'public:xfmg_med...', Array)
#14 src/XF/Mvc/Dispatcher.php(460): XF\Mvc\Renderer\Json->renderView('XFMG:Media\\Ligh...', 'public:xfmg_med...', Array)
#15 src/XF/Mvc/Dispatcher.php(442): XF\Mvc\Dispatcher->renderView(Object(XF\Mvc\Renderer\Json), Object(XF\Mvc\Reply\View))
#16 src/XF/Mvc/Dispatcher.php(402): XF\Mvc\Dispatcher->renderReply(Object(XF\Mvc\Renderer\Json), Object(XF\Mvc\Reply\View))
#17 src/XF/Mvc/Dispatcher.php(60): XF\Mvc\Dispatcher->render(Object(XF\Mvc\Reply\View), 'json')
#18 src/XF/App.php(2353): XF\Mvc\Dispatcher->run()
#19 src/XF.php(524): XF\App->run()
#20 index.php(20): XF::runApp('XF\\Pub\\App')
#21 {main}

Code:
array(4) {
  ["url"] => string(193) "/galerie/20220329_124515-jpg.6171/?lightbox=true&_xfRequestUri=%2Fgalerie%2F20220329_124515-jpg.6171%2F&_xfWithData=1&_xfToken=1681290740%2C7a9655733efcaf7d4890dbbcf87f82fb&_xfResponseType=json"
  ["referrer"] => string(60) "https://www.my-forum.de/galerie/20220329_124515-jpg.6171/"
  ["_GET"] => array(5) {
    ["lightbox"] => string(4) "true"
    ["_xfRequestUri"] => string(34) "/galerie/20220329_124515-jpg.6171/"
    ["_xfWithData"] => string(1) "1"
    ["_xfToken"] => string(43) "1681290740,7a9655733efcaf7d4890dbbcf87f82fb"
    ["_xfResponseType"] => string(4) "json"
  }
  ["_POST"] => array(0) {
  }
}


PHP 8.2.x
MariaDB 10.3.x
Xenforo 2.2.x / default Style
 

ottoZF

New Member
Ok, I updated now xfa core to the latest (1.14.1) and hope this solved the error. I am be back later... :)
 

ottoZF

New Member
OK, no - the latest XFA core add-on version doesnt help to fix the error. The error stil exist as before. :-(
 

McAtze

New Member
@ottoZF do you know that php8.2 is not fully supported and recommend for XenForo? Official recommend is php 8.0 and inofficial is php8.1
 

Clement

Freaky Coder
Staff member
Can you try to replace the code at line:
PHP:
src/addons/XFA/XFMGMediaOfTheMonth/XFMG/Entity/MediaItem.php:50

Replace:
PHP:
if (!$this->Album->xfa_motm)

By:
PHP:
if (!$this->Album || !$this->Album->xfa_motm)
 
O

OttoZF (old)

Guest
My bad - I use in this one of my forums php 8.1.x not 8.2.x
I realy hope I will be not to old to experienc a Xenforo 2.3 with full php 8.2 compatibility in the next years... :D ;)

@Clement
Thanks i give it a try and tell you if it works. :)
 
Last edited by a moderator:
O

OttoZF (old)

Guest
After first tests, it seems that its working for me. I ll take tomorow a second look and tell you if the errors are gone. Thanks. :)
 
Top