ErrorException: Array to string conversion - library/XenForo/Model/Node.php:1255
Stack Trace
#0 [internal function]: XenForo_Application::handlePhpError(8, 'Array to string...', '/home/xxx/...', 1255, Array)
#1 /home/xxx/public_html/library/XenForo/Model/Node.php(1255): strval(Array)
#2 /home/xxx/public_html/library/PrefixForumListing/Option/ForumMultipleChooser.php(31): XenForo_Model_Node->getNodeOptionsArray(Array, Array, '(belirtilmemi??...')
#3 /home/xxx/public_html/library/PrefixForumListing/Option/ForumMultipleChooser.php(65): PrefixForumListing_Option_ForumMultipleChooser::getNodeOptions(Array, '(belirtilmemi??...')
#4 /home/xxx/public_html/library/PrefixForumListing/Option/ForumMultipleChooser.php(8): PrefixForumListing_Option_ForumMultipleChooser::_render('option_list_opt...', Object(XenForo_ViewAdmin_Option_ListOptions), 'options', Array, false)
#5 [internal function]: PrefixForumListing_Option_ForumMultipleChooser::renderSelectM(Object(XenForo_ViewAdmin_Option_ListOptions), 'options', Array, false)
#6 /home/xxx/public_html/library/XenForo/ViewAdmin/Helper/Option.php(327): call_user_func(Array, Object(XenForo_ViewAdmin_Option_ListOptions), 'options', Array, false)
#7 /home/xxx/public_html/library/XenForo/ViewAdmin/Helper/Option.php(71): XenForo_ViewAdmin_Helper_Option::_renderCallbackOptionHtml(Object(XenForo_ViewAdmin_Option_ListOptions), 'options', Array, false)
#8 /home/xxx/public_html/library/XenForo/ViewAdmin/Helper/Option.php(33): XenForo_ViewAdmin_Helper_Option::renderPreparedOptionHtml(Object(XenForo_ViewAdmin_Option_ListOptions), Array, false, 'options')
#9 /home/xxx/public_html/library/XenForo/ViewAdmin/Option/ListOptions.php(30): XenForo_ViewAdmin_Helper_Option::renderPreparedOptionsHtml(Object(XenForo_ViewAdmin_Option_ListOptions), Array, false)
#10 /home/xxx/public_html/library/XenForo/ViewRenderer/Abstract.php(215): XenForo_ViewAdmin_Option_ListOptions->renderHtml()
#11 /home/xxx/public_html/library/XenForo/ViewRenderer/HtmlAdmin.php(63): XenForo_ViewRenderer_Abstract->renderViewObject('XenForo_ViewAdm...', 'Html', Array, 'option_list')
#12 /home/xxx/public_html/library/XenForo/FrontController.php(533): XenForo_ViewRenderer_HtmlAdmin->renderView('XenForo_ViewAdm...', Array, 'option_list', NULL)
#13 /home/xxx/public_html/library/XenForo/FrontController.php(156): XenForo_FrontController->renderView(Object(XenForo_ControllerResponse_View), Object(XenForo_ViewRenderer_HtmlAdmin), Array)
#14 /home/xxx/public_html/admin.php(13): XenForo_FrontController->run()
#15 {main}
Request State
array(3) {
["url"] => string(61) "http://xxx.com/admin.php?options/list/prefixForumListing"
["_GET"] => array(1) {
["options/list/prefixForumListing"] => string(0) ""
}
["_POST"] => array(0) {
}
}
open PrefixForumListing_Option_ForumMultipleChooserWe have started having the errors below when entering the admin section of this addon after upgrading the php on the server to 5.4
Code:ErrorException: Array to string conversion - library/XenForo/Model/Node.php:1255 Stack Trace #0 [internal function]: XenForo_Application::handlePhpError(8, 'Array to string...', '/home/xxx/...', 1255, Array) #1 /home/xxx/public_html/library/XenForo/Model/Node.php(1255): strval(Array) #2 /home/xxx/public_html/library/PrefixForumListing/Option/ForumMultipleChooser.php(31): XenForo_Model_Node->getNodeOptionsArray(Array, Array, '(belirtilmemi??...') #3 /home/xxx/public_html/library/PrefixForumListing/Option/ForumMultipleChooser.php(65): PrefixForumListing_Option_ForumMultipleChooser::getNodeOptions(Array, '(belirtilmemi??...') #4 /home/xxx/public_html/library/PrefixForumListing/Option/ForumMultipleChooser.php(8): PrefixForumListing_Option_ForumMultipleChooser::_render('option_list_opt...', Object(XenForo_ViewAdmin_Option_ListOptions), 'options', Array, false) #5 [internal function]: PrefixForumListing_Option_ForumMultipleChooser::renderSelectM(Object(XenForo_ViewAdmin_Option_ListOptions), 'options', Array, false) #6 /home/xxx/public_html/library/XenForo/ViewAdmin/Helper/Option.php(327): call_user_func(Array, Object(XenForo_ViewAdmin_Option_ListOptions), 'options', Array, false) #7 /home/xxx/public_html/library/XenForo/ViewAdmin/Helper/Option.php(71): XenForo_ViewAdmin_Helper_Option::_renderCallbackOptionHtml(Object(XenForo_ViewAdmin_Option_ListOptions), 'options', Array, false) #8 /home/xxx/public_html/library/XenForo/ViewAdmin/Helper/Option.php(33): XenForo_ViewAdmin_Helper_Option::renderPreparedOptionHtml(Object(XenForo_ViewAdmin_Option_ListOptions), Array, false, 'options') #9 /home/xxx/public_html/library/XenForo/ViewAdmin/Option/ListOptions.php(30): XenForo_ViewAdmin_Helper_Option::renderPreparedOptionsHtml(Object(XenForo_ViewAdmin_Option_ListOptions), Array, false) #10 /home/xxx/public_html/library/XenForo/ViewRenderer/Abstract.php(215): XenForo_ViewAdmin_Option_ListOptions->renderHtml() #11 /home/xxx/public_html/library/XenForo/ViewRenderer/HtmlAdmin.php(63): XenForo_ViewRenderer_Abstract->renderViewObject('XenForo_ViewAdm...', 'Html', Array, 'option_list') #12 /home/xxx/public_html/library/XenForo/FrontController.php(533): XenForo_ViewRenderer_HtmlAdmin->renderView('XenForo_ViewAdm...', Array, 'option_list', NULL) #13 /home/xxx/public_html/library/XenForo/FrontController.php(156): XenForo_FrontController->renderView(Object(XenForo_ControllerResponse_View), Object(XenForo_ViewRenderer_HtmlAdmin), Array) #14 /home/xxx/public_html/admin.php(13): XenForo_FrontController->run() #15 {main} Request State array(3) { ["url"] => string(61) "http://xxx.com/admin.php?options/list/prefixForumListing" ["_GET"] => array(1) { ["options/list/prefixForumListing"] => string(0) "" } ["_POST"] => array(0) { } }
protected static function _render($templateName, XenForo_View $view, $fieldPrefix, array $preparedOption, $canEdit)
{
$preparedOption['formatParams'] = self::getNodeOptions(
$preparedOption['option_value'],
sprintf('(%s)', new XenForo_Phrase('unspecified'))
);
return XenForo_ViewAdmin_Helper_Option::renderOptionTemplateInternal(
$templateName, $view, $fieldPrefix, $preparedOption, $canEdit, array('multiple')
);
}
protected static function _render($templateName, XenForo_View $view, $fieldPrefix, array $preparedOption, $canEdit)
{
$preparedOption['formatParams'] = self::getNodeOptions(
$preparedOption['option_value']
);
return XenForo_ViewAdmin_Helper_Option::renderOptionTemplateInternal(
$templateName, $view, $fieldPrefix, $preparedOption, $canEdit, array('multiple')
);
}
open PrefixForumListing_Option_ForumMultipleChooser
search for
replace withPHP:protected static function _render($templateName, XenForo_View $view, $fieldPrefix, array $preparedOption, $canEdit) { $preparedOption['formatParams'] = self::getNodeOptions( $preparedOption['option_value'], sprintf('(%s)', new XenForo_Phrase('unspecified')) ); return XenForo_ViewAdmin_Helper_Option::renderOptionTemplateInternal( $templateName, $view, $fieldPrefix, $preparedOption, $canEdit, array('multiple') ); }
PHP:protected static function _render($templateName, XenForo_View $view, $fieldPrefix, array $preparedOption, $canEdit) { $preparedOption['formatParams'] = self::getNodeOptions( $preparedOption['option_value'] ); return XenForo_ViewAdmin_Helper_Option::renderOptionTemplateInternal( $templateName, $view, $fieldPrefix, $preparedOption, $canEdit, array('multiple') ); }
try this pls![]()
Or should I be asking for you help, I'm confused :/Thank you for the support ragtek!
I did this and now I get a blank page instead of an error, any ideas?
NoMe too. Did you ever find a fix?
else
{
$prefix['totalThreads'] = $totalThreadsCache[$prefix['prefix_id']];
}
else
{
if ($options->pfl_showTotalThreads == 0 || ($options->pfl_showTotalThreads > 0 && $totalThreadsCache[$prefix['prefix_id']] >= $options->pfl_donotshow_totalthreads))
{
$prefix['totalThreads'] = $totalThreadsCache[$prefix['prefix_id']];
}
else
{
unset($prefixes[$key]);
}
}
FYI-- I made a quick fix for this when it wasn't hiding 0-count prefixes properly (when I had the setting configured to hide prefixes with no total). The problem is that it would hide the minimum total prefixes on first view, but when the cache was updated it would show them as (0) and ignore the "pfl_donotshow_totalthreads" option.
So I just moved the test into the cached section:
library\PrefixForumListing\Extend\ControllerPublic\Forum.php
Code:else { $prefix['totalThreads'] = $totalThreadsCache[$prefix['prefix_id']]; }
becomes
Code:else { if ($options->pfl_showTotalThreads == 0 || ($options->pfl_showTotalThreads > 0 && $totalThreadsCache[$prefix['prefix_id']] >= $options->pfl_donotshow_totalthreads)) { $prefix['totalThreads'] = $totalThreadsCache[$prefix['prefix_id']]; } else { unset($prefixes[$key]); } }
Hopefully this helps.
http://xenforo.com/community/threads/thread-prefix-listing.26811/page-3#post-407608It's a fix for the problem described here: http://xenforo.com/community/threads/thread-prefix-listing.26811/page-2#post-333590
I updated my thread above to clarify it.
I'm not seeing any problem where the addon throws an error (yet).
We use essential cookies to make this site work, and optional cookies to enhance your experience.