• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
All Topics - Master Forums / Global Topics

All Topics - Master Forums / Global Topics 1.5

No permission to download

Hyperion

Active member
#2
So if I have a topic marked as a sticky, say "Rules," in one forum, it will show up as a sticky topic in whichever other forums I specify?
 

Adam Howard

Well-known member
#9
I suspect this doesn't like php 5.4

PHP:
An exception occurred: Array to string conversion in /home/sociall1/public_html/forums/library/XenForo/Model/Node.php on line 1255
 
    XenForo_Application::handlePhpError()
    strval() in XenForo/Model/Node.php at line 1255
    XenForo_Model_Node->getNodeOptionsArray() in MasterForums/Option/ForumChooser.php at line 18
    MasterForums_Option_ForumChooser::renderOption()
    call_user_func() in XenForo/ViewAdmin/Helper/Option.php at line 327
    XenForo_ViewAdmin_Helper_Option::_renderCallbackOptionHtml() in XenForo/ViewAdmin/Helper/Option.php at line 71
    XenForo_ViewAdmin_Helper_Option::renderPreparedOptionHtml() in XenForo/ViewAdmin/Helper/Option.php at line 33
    XenForo_ViewAdmin_Helper_Option::renderPreparedOptionsHtml() in XenForo/ViewAdmin/Option/ListOptions.php at line 30
    XenForo_ViewAdmin_Option_ListOptions->renderHtml() in XenForo/ViewRenderer/Abstract.php at line 215
    XenForo_ViewRenderer_Abstract->renderViewObject() in XenForo/ViewRenderer/HtmlAdmin.php at line 63
    XenForo_ViewRenderer_HtmlAdmin->renderView() in XenForo/FrontController.php at line 533
    XenForo_FrontController->renderView() in XenForo/FrontController.php at line 156
    XenForo_FrontController->run() in /home/sociall1/public_html/forums/admin.php at line 13
^ I get that error on a nice white page, the moment I click on the settings for this modification
 

Adam Howard

Well-known member
#10
To add more information, this is what was in XenForo's error logs

Error Info
PHP:
ErrorException: Array to string conversion - library/XenForo/Model/Node.php:1255
Generated By: Adam, 6 minutes ago
Stack Trace

PHP:
#0 [internal function]: XenForo_Application::handlePhpError(8, 'Array to string...', '/home/sociall1/...', 1255, Array)
#1 /home/sociall1/public_html/forums/library/XenForo/Model/Node.php(1255): strval(Array)
#2 /home/sociall1/public_html/forums/library/MasterForums/Option/ForumChooser.php(18): XenForo_Model_Node->getNodeOptionsArray(Array, Array, '(unspecified)')
#3 [internal function]: MasterForums_Option_ForumChooser::renderOption(Object(XenForo_ViewAdmin_Option_ListOptions), 'options', Array, false)
#4 /home/sociall1/public_html/forums/library/XenForo/ViewAdmin/Helper/Option.php(327): call_user_func(Array, Object(XenForo_ViewAdmin_Option_ListOptions), 'options', Array, false)
#5 /home/sociall1/public_html/forums/library/XenForo/ViewAdmin/Helper/Option.php(71): XenForo_ViewAdmin_Helper_Option::_renderCallbackOptionHtml(Object(XenForo_ViewAdmin_Option_ListOptions), 'options', Array, false)
#6 /home/sociall1/public_html/forums/library/XenForo/ViewAdmin/Helper/Option.php(33): XenForo_ViewAdmin_Helper_Option::renderPreparedOptionHtml(Object(XenForo_ViewAdmin_Option_ListOptions), Array, false, 'options')
#7 /home/sociall1/public_html/forums/library/XenForo/ViewAdmin/Option/ListOptions.php(30): XenForo_ViewAdmin_Helper_Option::renderPreparedOptionsHtml(Object(XenForo_ViewAdmin_Option_ListOptions), Array, false)
#8 /home/sociall1/public_html/forums/library/XenForo/ViewRenderer/Abstract.php(215): XenForo_ViewAdmin_Option_ListOptions->renderHtml()
#9 /home/sociall1/public_html/forums/library/XenForo/ViewRenderer/HtmlAdmin.php(63): XenForo_ViewRenderer_Abstract->renderViewObject('XenForo_ViewAdm...', 'Html', Array, 'option_list')
#10 /home/sociall1/public_html/forums/library/XenForo/FrontController.php(533): XenForo_ViewRenderer_HtmlAdmin->renderView('XenForo_ViewAdm...', Array, 'option_list', NULL)
#11 /home/sociall1/public_html/forums/library/XenForo/FrontController.php(156): XenForo_FrontController->renderView(Object(XenForo_ControllerResponse_View), Object(XenForo_ViewRenderer_HtmlAdmin), Array)
#12 /home/sociall1/public_html/forums/admin.php(13): XenForo_FrontController->run()
#13 {main}
Request State

PHP:
array(3) {
  ["url"] => string(75) "http://www.sociallyuncensored.eu/forums/admin.php?options/list/MasterForums"
  ["_GET"] => array(1) {
    ["options/list/MasterForums"] => string(0) ""
  }
  ["_POST"] => array(0) {
  }
}
 

Chris D

XenForo developer
Staff member
#12
I suspect this doesn't like php 5.4

PHP:
An exception occurred: Array to string conversion in /home/sociall1/public_html/forums/library/XenForo/Model/Node.php on line 1255
 
    XenForo_Application::handlePhpError()
    strval() in XenForo/Model/Node.php at line 1255
    XenForo_Model_Node->getNodeOptionsArray() in MasterForums/Option/ForumChooser.php at line 18
    MasterForums_Option_ForumChooser::renderOption()
    call_user_func() in XenForo/ViewAdmin/Helper/Option.php at line 327
    XenForo_ViewAdmin_Helper_Option::_renderCallbackOptionHtml() in XenForo/ViewAdmin/Helper/Option.php at line 71
    XenForo_ViewAdmin_Helper_Option::renderPreparedOptionHtml() in XenForo/ViewAdmin/Helper/Option.php at line 33
    XenForo_ViewAdmin_Helper_Option::renderPreparedOptionsHtml() in XenForo/ViewAdmin/Option/ListOptions.php at line 30
    XenForo_ViewAdmin_Option_ListOptions->renderHtml() in XenForo/ViewRenderer/Abstract.php at line 215
    XenForo_ViewRenderer_Abstract->renderViewObject() in XenForo/ViewRenderer/HtmlAdmin.php at line 63
    XenForo_ViewRenderer_HtmlAdmin->renderView() in XenForo/FrontController.php at line 533
    XenForo_FrontController->renderView() in XenForo/FrontController.php at line 156
    XenForo_FrontController->run() in /home/sociall1/public_html/forums/admin.php at line 13
^ I get that error on a nice white page, the moment I click on the settings for this modification
That's... interesting.

The code for the ForumChooser is from one of Jaxel's add-ons (used with permission).

I wonder if you would have the same problem with that add-on or whether it's some of my code that's broken it.

EDIT: Yeah the ForumChooser code is from XenMedio. I wonder if that is broken on PHP 5.4.

EDIT 2: Although I do have some code that converts the array into a string. I may not need that now. Let me investigate a fix before uninstalling.
 

Chris D

XenForo developer
Staff member
#13
I can confirm two things:

1) This is a bug in the ForumChooser code used by XenPorta, XenMedio, XenAttendo, MasterForums and anywhere else I or Jaxel may have used the ForumChooser code.
2) It only affects PHP 5.4
3) It's nothing to do specifically with my add-on, just this Forum Chooser.

Jaxel has told people to downgrade to PHP 5.3 to solve this problem... I'll see if there's anything I can do to fix for 5.4.
 

Chris D

XenForo developer
Staff member
#14
Well, that was easy:

Remove the red code from MasterForums/Options/ForumChooser.php:

Code:
$forumOptions = $nodeModel->getNodeOptionsArray($nodeModel->getAllNodes(), $preparedOption['option_value'], '(unspecified)');
All this does is remove the "Unspecified" option from the forum chooser. That should be fine, and isn't really necessary for this particular add-on as for it to work you can't have an unspecified forum.

EDIT: 8thos, are you ok doing the code edit and updating the resource?
 

Adam Howard

Well-known member
#15
Well, that was easy:

Remove the red code from MasterForums/Options/ForumChooser.php:

Code:
$forumOptions = $nodeModel->getNodeOptionsArray($nodeModel->getAllNodes(), $preparedOption['option_value'], '(unspecified)');
All this does is remove the "Unspecified" option from the forum chooser. That should be fine, and isn't really necessary for this particular add-on as for it to work you can't have an unspecified forum.

EDIT: 8thos, are you ok doing the code edit and updating the resource?
NOPE, did not resolve the issue for me. :( Good try though.
 

Chris D

XenForo developer
Staff member
#16
NOPE, did not resolve the issue for me. :( Good try though.
That has to work... I got the same problem as you with PHP 5.4 and then after doing that code edit, it fixed it.

Our errors were identical including this line which is where the code edit takes place:

XenForo_Model_Node->getNodeOptionsArray() in MasterForums/Option/ForumChooser.php at line 18

Has the error now changed, at least?
 

DRE

Well-known member
#17
Well, that was easy:

Remove the red code from MasterForums/Options/ForumChooser.php:

Code:
$forumOptions = $nodeModel->getNodeOptionsArray($nodeModel->getAllNodes(), $preparedOption['option_value'], '(unspecified)');
All this does is remove the "Unspecified" option from the forum chooser. That should be fine, and isn't really necessary for this particular add-on as for it to work you can't have an unspecified forum.

EDIT: 8thos, are you ok doing the code edit and updating the resource?
Yes I can update it but I want to wait to see if it works for him first.
 

Adam Howard

Well-known member
#18
That has to work... I got the same problem as you with PHP 5.4 and then after doing that code edit, it fixed it.

Our errors were identical including this line which is where the code edit takes place:

XenForo_Model_Node->getNodeOptionsArray() in MasterForums/Option/ForumChooser.php at line 18

Has the error now changed, at least?
I tried just removing the code you suggested and and error moved to a new line (24)

PHP:
An exception occurred: Undefined variable: forumOptions in /home/sociall1/public_html/forums/library/MasterForums/Option/ForumChooser.php on line 24
 
    XenForo_Application::handlePhpError() in MasterForums/Option/ForumChooser.php at line 24
    MasterForums_Option_ForumChooser::renderOption()
    call_user_func() in XenForo/ViewAdmin/Helper/Option.php at line 327
    XenForo_ViewAdmin_Helper_Option::_renderCallbackOptionHtml() in XenForo/ViewAdmin/Helper/Option.php at line 71
    XenForo_ViewAdmin_Helper_Option::renderPreparedOptionHtml() in XenForo/ViewAdmin/Helper/Option.php at line 33
    XenForo_ViewAdmin_Helper_Option::renderPreparedOptionsHtml() in XenForo/ViewAdmin/Option/ListOptions.php at line 30
    XenForo_ViewAdmin_Option_ListOptions->renderHtml() in XenForo/ViewRenderer/Abstract.php at line 215
    XenForo_ViewRenderer_Abstract->renderViewObject() in XenForo/ViewRenderer/HtmlAdmin.php at line 63
    XenForo_ViewRenderer_HtmlAdmin->renderView() in XenForo/FrontController.php at line 533
    XenForo_FrontController->renderView() in XenForo/FrontController.php at line 156
    XenForo_FrontController->run() in /home/sociall1/public_html/forums/admin.php at line 13
Decided to investigate possible "white space" issues and removed the wide space before it ... I know, unlikely, but never hurts to check.... Same error as above

Decided to remove the space above and below (again, double checking white space) and the error changed (line 22)

PHP:
An exception occurred: Undefined variable: forumOptions in /home/sociall1/public_html/forums/library/MasterForums/Option/ForumChooser.php on line 22
 
    XenForo_Application::handlePhpError() in MasterForums/Option/ForumChooser.php at line 22
    MasterForums_Option_ForumChooser::renderOption()
    call_user_func() in XenForo/ViewAdmin/Helper/Option.php at line 327
    XenForo_ViewAdmin_Helper_Option::_renderCallbackOptionHtml() in XenForo/ViewAdmin/Helper/Option.php at line 71
    XenForo_ViewAdmin_Helper_Option::renderPreparedOptionHtml() in XenForo/ViewAdmin/Helper/Option.php at line 33
    XenForo_ViewAdmin_Helper_Option::renderPreparedOptionsHtml() in XenForo/ViewAdmin/Option/ListOptions.php at line 30
    XenForo_ViewAdmin_Option_ListOptions->renderHtml() in XenForo/ViewRenderer/Abstract.php at line 215
    XenForo_ViewRenderer_Abstract->renderViewObject() in XenForo/ViewRenderer/HtmlAdmin.php at line 63
    XenForo_ViewRenderer_HtmlAdmin->renderView() in XenForo/FrontController.php at line 533
    XenForo_FrontController->renderView() in XenForo/FrontController.php at line 156
    XenForo_FrontController->run() in /home/sociall1/public_html/forums/admin.php at line 13
 

Chris D

XenForo developer
Staff member
#19
Did you remove the whole line, or just the part I highlighted in red?

This is the only bit that should have been removed from line 18:

Code:
, '(unspecified)'
I get the same error as you if I remove the whole line.

Line 18 should look like this:

Code:
$forumOptions = $nodeModel->getNodeOptionsArray($nodeModel->getAllNodes(), $preparedOption['option_value']);
 

Adam Howard

Well-known member
#20
Did you remove the whole line, or just the part I highlighted in red?

This is the only bit that should have been removed from line 18:

Code:
, '(unspecified)'
I get the same error as you if I remove the whole line.

Line 18 should look like this:

Code:
$forumOptions = $nodeModel->getNodeOptionsArray($nodeModel->getAllNodes(), $preparedOption['option_value']);
I didn't notice the "red" high light. I should have scrolled it and not did a quick copy and paste (search and remove). :oops:

lol

YES, it works.