nrep
Well-known member
I've got a conditional statement which appears to throw up some errors in debug mode, which I'd like to fix:
<xen:if is="!in_array({$forum.node_id}, {$xenOptions.threadtt_nodes})">
This problem appears because $xenOptions['threadtt_nodes'] isn't set at the moment. Is there a way around this error by modifying the conditional? I don't want to have to change the template code if a variable is/isn't set.
BTW, I'm aware this may appear like a strange request given that this is a xenOptions variable - but I'm interested to see if there's a way to avoid the error appearing if a variable doesn't exist yet.
<xen:if is="!in_array({$forum.node_id}, {$xenOptions.threadtt_nodes})">
Code:
1.in_array() expects parameter 2 to be array, null given in \library\XenForo\Template\Abstract.php(265) : eval()'d code, line 1409: 1408: ';
1409: if (!in_array($forum['node_id'], $xenOptions['threadtt_nodes']))
1410: {
This problem appears because $xenOptions['threadtt_nodes'] isn't set at the moment. Is there a way around this error by modifying the conditional? I don't want to have to change the template code if a variable is/isn't set.
BTW, I'm aware this may appear like a strange request given that this is a xenOptions variable - but I'm interested to see if there's a way to avoid the error appearing if a variable doesn't exist yet.