hstammlerj
Active member
- Affected version
- 2.1.10 Patch 2
One single (self-coded) if-clause in template thread_view:
...causes big mess if the thread starter isn't registered anymore.
Passing a user_id=0 to canStartConversationWith() affects this error:
The original thread displayed w/o error: https://www.rc-network.de/threads/asw-15-b.9352/
My workaround: Capsuling if-clauses inside each other, first/outside checking if the thread starter still exists and afterwards/inside calling the user-entities. Since there are more issues reported in the past, it feels to me like it could be a general issue around that entity.
At least one bug report is proposed to be fixed for a special case:
---
Others are more unclear or discussed add-on related, also in 2.2 branch:
It looks like most people build pre-check workarounds to fix the issues. For me, it's not clear if that's the way it should be or not:
You can say: It's a "bad template" problem.
Or you can say: The object isn't able to cope an empty/NULL id value correctly, since it throws a hard error instead of e.g. an empty result.
My gut feeling: Capsuling independent calls because they screw up fully if they've been given an empty parameter just doesn't feel right for me...
Code:
<xf:if is="$xf.visitor.canStartConversationWith($thread.User)">
Passing a user_id=0 to canStartConversationWith() affects this error:
Code:
An exception occurred: [TypeError] Argument 1 passed to XF\Entity\User::canStartConversationWith() must be an instance of XF\Entity\User, null given in src/XF/Entity/User.php on line 828
XF\Entity\User->canStartConversationWith()
call_user_func_array() in src/XF/Template/Templater.php at line 999
XF\Template\Templater->method() in internal_data/code_cache/templates/l13/s4/public/thread_view.php at line 712
XF\Template\Templater->{closure}() in src/XF/Template/Templater.php at line 1315
XF\Template\Templater->renderTemplate() in src/XF/Template/Template.php at line 24
XF\Template\Template->render() in src/XF/Mvc/Renderer/Html.php at line 48
XF\Mvc\Renderer\Html->renderView() in src/XF/Mvc/Dispatcher.php at line 458
XF\Mvc\Dispatcher->renderView() in src/XF/Mvc/Dispatcher.php at line 440
XF\Mvc\Dispatcher->renderReply() in src/XF/Mvc/Dispatcher.php at line 400
XF\Mvc\Dispatcher->render() in src/XF/Mvc/Dispatcher.php at line 58
XF\Mvc\Dispatcher->run() in src/XF/App.php at line 2190
XF\App->run() in src/XF.php at line 391
XF::runApp() in index.php at line 20
Code:
array(4) {
["url"] => string(23) "/threads/asw-15-b.9352/"
["referrer"] => bool(false)
["_GET"] => array(0) {
}
["_POST"] => array(0) {
}
}
The original thread displayed w/o error: https://www.rc-network.de/threads/asw-15-b.9352/
My workaround: Capsuling if-clauses inside each other, first/outside checking if the thread starter still exists and afterwards/inside calling the user-entities. Since there are more issues reported in the past, it feels to me like it could be a general issue around that entity.
At least one bug report is proposed to be fixed for a special case:
Fixed - Argument 1 passed to XF\Repository\ConnectedAccount::rebuildUserConnectedAccountCache() must be an instance of XF\Entity\User, null given
Server error log TypeError: Argument 1 passed to XF\Repository\ConnectedAccount::rebuildUserConnectedAccountCache() must be an instance of XF\Entity\User, null given, called in /home/nginx/domains/site.com/public/src/XF/Entity/UserConnectedAccount.php on line 36...
xenforo.com
Others are more unclear or discussed add-on related, also in 2.2 branch:
Cannot reproduce - Server Error
I have had guests trigger the following error: ErrorException: Template error: Method canViewMedia is not callable on the given object (XF\Entity\User) src/XF/Template/Templater.php:994 Generated by: Unknown account May 31, 2020 Stack trace #0 [internal function]...
xenforo.com
Warning Improvements by Xon - Updates
xenforo.com
XF 2.0 - Unknown user ruined my upgrades
Hi This Unknown user never expire and it bugged my other upgrades so let's say your ugprade ends today , it will not because of this Unknown user And server error logs TypeError: Argument 3 passed to XF\Service\User\Downgrade::__construct() must be an instance of XF\Entity\User, null given...
xenforo.com
Not a bug - Template error: Cannot call method getUserTitles
I don't know if is a bug or related with an add-on I get this error when a guest post a thread Server error log ErrorException: Template error: Cannot call method getUserTitles on a non-object (NULL) src/XF/Template/Templater.php:1150 Stack trace #0 [internal function]...
xenforo.com
XF2 [8WR] XenPorta 2 (Portal) PRO [Paid]
Hi Jaxel, I'm receiving many of these server errors: Error server registry: TypeError: Argument 1 passed to XF\Entity\User::canFollowUser() must be an instance of XF\Entity\User, null given src/XF/Entity/User.php:726 Generato da: Account sconosciuto 18 Giu 2020 alle 10:07 Stack Analisys #0...
xenforo.com
It looks like most people build pre-check workarounds to fix the issues. For me, it's not clear if that's the way it should be or not:
You can say: It's a "bad template" problem.
Or you can say: The object isn't able to cope an empty/NULL id value correctly, since it throws a hard error instead of e.g. an empty result.
My gut feeling: Capsuling independent calls because they screw up fully if they've been given an empty parameter just doesn't feel right for me...
Last edited: