Php 7 - Errors on library/XenForo/Template/Helper/Core.php:1671

maxicep

Active member
Hello

When i click the recent-activity page, we take server error and page can't open. Just blank white page with an error.

Code:
Server Error Log
Error Info
TypeError: Argument 1 passed to XenForo_Template_Helper_Core::helperUserNameHtml() must be of the type array, null given, called in /home/nginx/domains/domain.com/public/forum/library/XenForo/Template/Helper/Core.php on line 853 -library/XenForo/Template/Helper/Core.php:1671
Generated By: Admin, 2 minutes ago
Stack Trace
#0 /home/nginx/domains/domain.com/public/forum/library/XenForo/Template/Helper/Core.php(853): XenForo_Template_Helper_Core::helperUserNameHtml(NULL, '', false, Array)
#1 /home/nginx/domains/domain.com/public/forum/internal_data/templates/S.2,L.2,news_feed_page_global.php(220): XenForo_Template_Helper_Core::callHelper('usernamehtml', Array)
#2 /home/nginx/domains/domain.com/public/forum/library/XenForo/Template/Abstract.php(260): include('/home/nginx/dom...')
#3 /home/nginx/domains/domain.com/public/forum/library/XenForo/Template/Abstract.php(191): XenForo_Template_Abstract->_renderInternal('/home/nginx/dom...', Array)
#4 /home/nginx/domains/domain.com/public/forum/library/XenForo/Template/Public.php(110): XenForo_Template_Abstract->render()
#5 /home/nginx/domains/domain.com/public/forum/library/XenForo/ViewRenderer/HtmlPublic.php(123): XenForo_Template_Public->render()
#6 /home/nginx/domains/domain.com/public/forum/library/XenForo/FrontController.php(637): XenForo_ViewRenderer_HtmlPublic->renderContainer(Object(XenForo_Template_Public), Array)
#7 /home/nginx/domains/domain.com/public/forum/library/XenForo/FrontController.php(158): XenForo_FrontController->renderView(Object(XenForo_ControllerResponse_View), Object(XenForo_ViewRenderer_HtmlPublic), Array)
#8 /home/nginx/domains/domain.com/public/forum/index.php(13): XenForo_FrontController->run()
#9 {main}
Request State
array(3) {
  ["url"] => string(43) "http://www.domain.com/forum/haber-kaynagi/"
  ["_GET"] => array(1) {
    ["/forum/haber-kaynagi/"] => string(0) ""
  }
  ["_POST"] => array(0) {
  }
}
 
At this stage, with this error, I don't believe this to be a bug or specifically PHP 7 related.

Please try disabling all add ons and try again.
 
At this stage, with this error, I don't believe this to be a bug or specifically PHP 7 related.

Please try disabling all add ons and try again.
I tried disable all listeners via config.php and tried disable the custom route even..

I see that content only on white blank page when i call the page.

Code:
An exception occurred: Argument 1 passed to XenForo_Template_Helper_Core::helperUserNameHtml() must be of the type array, null given, called in /home/nginx/domains/domain.com/public/forum/library/XenForo/Template/Helper/Core.php on line 853 in /home/nginx/domains/domain.com/public/forum/library/XenForo/Template/Helper/Core.php on line 1671
    1.    XenForo_Template_Helper_Core::helperUserNameHtml() in XenForo/Template/Helper/Core.php at line 853
    2.    XenForo_Template_Helper_Core::callHelper() in /home/nginx/domains/domain.com/public/forum/internal_data/templates/S.2,L.2,news_feed_page_global.php at line 220
    3.    include() in XenForo/Template/Abstract.php at line 260
    4.    XenForo_Template_Abstract->_renderInternal() in XenForo/Template/Abstract.php at line 191
    5.    XenForo_Template_Abstract->render() in XenForo/Template/Public.php at line 110
    6.    XenForo_Template_Public->render() in XenForo/ViewRenderer/HtmlPublic.php at line 123
    7.    XenForo_ViewRenderer_HtmlPublic->renderContainer() in XenForo/FrontController.php at line 637
    8.    XenForo_FrontController->renderView() in XenForo/FrontController.php at line 158
    9.    XenForo_FrontController->run() in /home/nginx/domains/domain.com/public/forum/index.php at line 13

I tried to see in default theme, and it works. This related only my theme.
But interesting, i have no changed any starting with "news_feed" template. So, which template related with this recent-activity page ?

Thanks.
 
Last edited:
Simple temporary solution to see if it is a PHP 7.0.1 issue (since you are on CentMin) is regress back to PHP 5.6.16 and see if the issue is still there.
 
It is too hard process for now php downgrade / upgrade but i haven't seen before this error on my admin panel ( i used php 5.x for a long time) so i think it is related with php 7 problem but i don't see error on default template. My custom template does that. But i don't understand what is problem on my theme because news_feed _xxxx templates not modified.
 
It is too hard process for now php downgrade / upgrade but i haven't seen before this error on my admin panel ( i used php 5.x for a long time) so i think it is related with php 7 problem but i don't see error on default template. My custom template does that. But i don't understand what is problem on my theme because news_feed _xxxx templates not modified.
Errrr.. you use CentMin and it's "too hard" to downgrade the PHP version?
I was running PHP 7.0.1 and downgraded to 5.6.16... only had to wait on it to compile the new PHP

Screen-Shot-2015-12-24-at-12.18.12-PM.webp

Screen-Shot-2015-12-24-at-12.19.59-PM.webp
 
I know that of course but hardly process on real time working big forum. I don't prefer it also because of i didn't see this error on php 5.x series for a long time. So problem is clearly php 7 already.
 
Look at the "customizations" to your template and see if it's calling anything differently - or passing custom parameters. That may be the most likely culprit since it doesn't effect the default templates apparently.
 
Thank you for your helpfull firstly.

And may you see any hint if look the stack trace or error details ? Which part, variable or anything do that i can't find it.
 
What link are you trying to call
What template did you modify that you referred to?
I see a reference to
Code:
Argument 1 passed
in there.. make sure that none of the modifications you did that calls another template passes an blank space as a variable.
 
I tried disable all listeners via config.php and tried disable the custom route even..

I see that content only on white blank page when i call the page.

Code:
An exception occurred: Argument 1 passed to XenForo_Template_Helper_Core::helperUserNameHtml() must be of the type array, null given, called in /home/nginx/domains/domain.com/public/forum/library/XenForo/Template/Helper/Core.php on line 853 in /home/nginx/domains/domain.com/public/forum/library/XenForo/Template/Helper/Core.php on line 1671
    1.    XenForo_Template_Helper_Core::helperUserNameHtml() in XenForo/Template/Helper/Core.php at line 853
    2.    XenForo_Template_Helper_Core::callHelper() in /home/nginx/domains/domain.com/public/forum/internal_data/templates/S.2,L.2,news_feed_page_global.php at line 220
    3.    include() in XenForo/Template/Abstract.php at line 260
    4.    XenForo_Template_Abstract->_renderInternal() in XenForo/Template/Abstract.php at line 191
    5.    XenForo_Template_Abstract->render() in XenForo/Template/Public.php at line 110
    6.    XenForo_Template_Public->render() in XenForo/ViewRenderer/HtmlPublic.php at line 123
    7.    XenForo_ViewRenderer_HtmlPublic->renderContainer() in XenForo/FrontController.php at line 637
    8.    XenForo_FrontController->renderView() in XenForo/FrontController.php at line 158
    9.    XenForo_FrontController->run() in /home/nginx/domains/domain.com/public/forum/index.php at line 13

I tried to see in default theme, and it works. This related only my theme.
But interesting, i have no changed any starting with "news_feed" template. So, which template related with this recent-activity page ?

Thanks.
As this is potentially template related it isn't sufficient to disable listeners. Doing that doesn't disable template modifications or content type handlers.

You will have to disable all add ons and re-enable one by one until you find the culprit.
 
Quickest way is looking at your "customized components" for that style in the ACP.
Also, just for grins and giggles - try rebuilding the master data. Won't hurt anything.
 
As this is potentially template related it isn't sufficient to disable listeners. Doing that doesn't disable template modifications or content type handlers.

You will have to disable all add ons and re-enable one by one until you find the culprit.
Is disable all listeners via config.php can't disable all add-ons already ? I know that if disable all listeners then plugins will be ineffective same as disabled all add-ons ? Am i wrong?
 
Yes, you need to also go in and disable them from the ACP. From my understanding, doing that will also disable any template modifications. Then re-enable them one at a time until (and if) you get the error again. Although, if it was an add-on, I'd think it would also effect your default template.
 
Am i wrong?
Unfortunately, yes.

Add-ons can consist of code event listeners, cron entries, content type handlers, template modifications and rather much more. If you disable listeners in config.php you're only disabling listeners, potentially leaving everything else enabled. It's often the case that disabling listeners is enough, but not always.
 
Back
Top Bottom