Fixed Review from deleted user causes errors

sub_ubi

Well-known member
Affected version
2.0.3
Tested on a site with no other addons.
XF 2.0.10 and XFRM 2.0.3

User leaves review of a resource. User is deleted. Errors begin showing a few hours later.

Code:
InvalidArgumentException: Accessed unknown getter 'username' on XFRM:ResourceRating[9] src/XF/Mvc/Entity/Entity.php:182
Generated by: Unknown account Sep 21, 2018 at 4:20 AM

Code:
Stack trace
#0 src/XF/Mvc/Entity/Entity.php(100): XF\Mvc\Entity\Entity->get('username')
#1 internal_data/code_cache/templates/l1/s1/public/xfrm_resource_review_macros.php(421): XF\Mvc\Entity\Entity->offsetGet('username')
#2 src/XF/Template/Templater.php(663): XF\Template\Templater->{closure}(Object(XF\Template\Templater), Array, Array)
#3 internal_data/code_cache/templates/l1/s1/public/xfrm_widget_latest_reviews.php(21): XF\Template\Templater->callMacro('xfrm_resource_r...', 'review_simple', Array, Array)
#4 src/XF/Template/Templater.php(1250): XF\Template\Templater->{closure}(Object(XF\Template\Templater), Array)
#5 src/XF/Widget/WidgetRenderer.php(62): XF\Template\Templater->renderTemplate('xfrm_widget_lat...', Array)
#6 src/XF/Widget/WidgetRenderer.php(67): XF\Widget\WidgetRenderer->render()
#7 src/XF/Template/Templater.php(1526): XF\Widget\WidgetRenderer->__toString()
#8 internal_data/code_cache/templates/l1/s1/public/xfrm_overview.php(153): XF\Template\Templater->widgetPosition('xfrm_overview_s...', Array)
#9 src/XF/Template/Templater.php(1250): XF\Template\Templater->{closure}(Object(XF\Template\Templater), Array)
#10 src/XF/Template/Template.php(24): XF\Template\Templater->renderTemplate('xfrm_overview', Array)
#11 src/XF/Mvc/Renderer/Html.php(48): XF\Template\Template->render()
#12 src/XF/Mvc/Dispatcher.php(332): XF\Mvc\Renderer\Html->renderView('XFRM:Overview', 'public:xfrm_ove...', Array)
#13 src/XF/Mvc/Dispatcher.php(303): XF\Mvc\Dispatcher->renderView(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#14 src/XF/Mvc/Dispatcher.php(44): XF\Mvc\Dispatcher->render(Object(XF\Mvc\Reply\View), 'html')
#15 src/XF/App.php(1931): XF\Mvc\Dispatcher->run()
#16 src/XF.php(329): XF\App->run()
#17 index.php(13): XF::runApp('XF\\Pub\\App')
#18 {main}

Code:
Request state
array(4) {
  ["url"] => string(29) "/default/index.php?resources/"
  ["referrer"] => string(43) "https://www.sitename.com/default/index.php"
  ["_GET"] => array(1) {
    ["resources/"] => string(0) ""
  }
  ["_POST"] => array(0) {
  }
}


Code:
ErrorException: Template error: Accessed unknown getter 'username' on XFRM:ResourceRating[9] src/XF/Mvc/Entity/Entity.php:178
Generated by: Unknown account Sep 21, 2018 at 4:20 AM

Code:
Stack trace
#0 [internal function]: XF\Template\Templater->handleTemplateError(512, 'Accessed unknow...', '/var/www/sitena...', 178, Array)
#1 src/XF/Mvc/Entity/Entity.php(178): trigger_error('Accessed unknow...', 512)
#2 src/XF/Mvc/Entity/Entity.php(100): XF\Mvc\Entity\Entity->get('username')
#3 internal_data/code_cache/templates/l1/s1/public/xfrm_resource_review_macros.php(421): XF\Mvc\Entity\Entity->offsetGet('username')
#4 src/XF/Template/Templater.php(663): XF\Template\Templater->{closure}(Object(XF\Template\Templater), Array, Array)
#5 internal_data/code_cache/templates/l1/s1/public/xfrm_widget_latest_reviews.php(21): XF\Template\Templater->callMacro('xfrm_resource_r...', 'review_simple', Array, Array)
#6 src/XF/Template/Templater.php(1250): XF\Template\Templater->{closure}(Object(XF\Template\Templater), Array)
#7 src/XF/Widget/WidgetRenderer.php(62): XF\Template\Templater->renderTemplate('xfrm_widget_lat...', Array)
#8 src/XF/Widget/WidgetRenderer.php(67): XF\Widget\WidgetRenderer->render()
#9 src/XF/Template/Templater.php(1526): XF\Widget\WidgetRenderer->__toString()
#10 internal_data/code_cache/templates/l1/s1/public/xfrm_overview.php(153): XF\Template\Templater->widgetPosition('xfrm_overview_s...', Array)
#11 src/XF/Template/Templater.php(1250): XF\Template\Templater->{closure}(Object(XF\Template\Templater), Array)
#12 src/XF/Template/Template.php(24): XF\Template\Templater->renderTemplate('xfrm_overview', Array)
#13 src/XF/Mvc/Renderer/Html.php(48): XF\Template\Template->render()
#14 src/XF/Mvc/Dispatcher.php(332): XF\Mvc\Renderer\Html->renderView('XFRM:Overview', 'public:xfrm_ove...', Array)
#15 src/XF/Mvc/Dispatcher.php(303): XF\Mvc\Dispatcher->renderView(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#16 src/XF/Mvc/Dispatcher.php(44): XF\Mvc\Dispatcher->render(Object(XF\Mvc\Reply\View), 'html')
#17 src/XF/App.php(1931): XF\Mvc\Dispatcher->run()
#18 src/XF.php(329): XF\App->run()
#19 index.php(13): XF::runApp('XF\\Pub\\App')
#20 {main}

Code:
Request state
array(4) {
  ["url"] => string(29) "/default/index.php?resources/"
  ["referrer"] => string(43) "https://www.sitename.com/default/index.php"
  ["_GET"] => array(1) {
    ["resources/"] => string(0) ""
  }
  ["_POST"] => array(0) {
  }
}
 
Thank you for reporting this issue. The issue is now resolved and we are aiming to include that in a future XFRM release (2.0.5).

Change log:
Prevent an error from being logged when a "simple" resource review, written by a deleted member, is displayed
Any changes made as a result of this issue being resolved may not be rolled out here until later.
 
Back
Top Bottom