cclaerhout / xen_BBM_v2

Version 2 of the BbCodes and Buttons Manager (BBM) for XenForo (working with TinyMCE 4)
6 stars 1 forks source link

Major issue upgrading to 3.3.0 #21

Closed Xon closed 9 years ago

Xon commented 9 years ago

On deploying the files, but before the XML file upgrade the following error caused my entire site to go offline with errors basically everywhere:

array_intersect(): Argument #2 is not an array library/BBM/Helper/Buttons.php

#0 [internal function]: XenForo_Application::handlePhpError(2, 'array_intersect...', '/var/www/sites/...', 558, Array)
#1 /var/www/html/library/BBM/Helper/Buttons.php(558): array_intersect(Array, NULL)
#2 /var/www/html/library/BBM/Helper/Buttons.php(266): BBM_Helper_Buttons::_bakeRedactorParams(Array)
#3 /var/www/html/library/BBM/Helper/Buttons.php(69): BBM_Helper_Buttons::_bakeExtraParams('a:44:{i:0;a:8:{...', Object(XenForo_Options), Object(XenForo_Visitor))
#4 /var/www/html/library/Sedo/TinyQuattro/Helper/Quattro.php(125): BBM_Helper_Buttons::getConfig('XenForo_Control...', 'Index', 'XenForo_ViewPub...')
#5 /var/www/html/library/Sedo/TinyQuattro/Helper/Quattro.php(65): Sedo_TinyQuattro_Helper_Quattro::checkAndGetBbmConfig(Array)
#6 /var/www/html/library/Sedo/TinyQuattro/Listener/AllInOne.php(288): Sedo_TinyQuattro_Helper_Quattro::isEnabled(true, Array)
#7 /var/www/html/library/Sedo/TinyQuattro/Listener/AllInOne.php(235): Sedo_TinyQuattro_Listener_AllInOne::_controllerPreView(Object(XenForo_FrontController), Object(XenForo_ControllerResponse_View), Object(XenForo_ViewRenderer_Json), Array)
#8 [internal function]: Sedo_TinyQuattro_Listener_AllInOne::controllerPreView(Object(XenForo_FrontController), Object(XenForo_ControllerResponse_View), Object(XenForo_ViewRenderer_Json), Array)
#9 /var/www/html/library/XenForo/CodeEvent.php(90): call_user_func_array(Array, Array)
#10 /var/www/html/library/XenForo/FrontController.php(156): XenForo_CodeEvent::fire('front_controlle...', Array)
#11 /var/www//html/index.php(13): XenForo_FrontController->run()
#12 {main}
``
cclaerhout commented 9 years ago

Since the array is set just above in the function ($xenParsingBbCodesPerms), I don't really get it...

cclaerhout commented 9 years ago

Oh may be the perms for the button are not yet available, so we just need to check them.

Xon commented 9 years ago

I had to disable listeners, and then upgrade the XML. After that everything worked.

cclaerhout commented 9 years ago

Oh, I think I get it. If you upload files first, the option is not there yet. So XenForo will not send an empty array but a null value. I will add an extra key check just for the update process.

Xon commented 9 years ago

:+1:

Xon commented 9 years ago

https://github.com/cclaerhout/xen_BBM_v2/commit/a4dd09c0f8eed3e2e9a653f75ff87d8ec974c572 only does _bakeQuattroParams. This affects the _bakeRedactorParams too.

Xon commented 9 years ago

Actually this also affects anything which touches: $this->_bbmXenTagsParsingAllowedUsergroups $this->_bbmXenTagsParsingAllowedNodes

in BBM_BbCode_Formatter_Base::bakeBbmTags

cclaerhout commented 9 years ago

Ok I will check this later ; thanks !

Xon commented 9 years ago

Cheers. I'll work up a diff after tracking how those two variables are used.

cclaerhout commented 9 years ago

$this->_bbmXenTagsParsingAllowedUsergroups => yes it needs it $this->_bbmXenTagsParsingAllowedNodes => it should work without any mods (an empty check was already there)

Xon commented 9 years ago

bbmXenTagsParsingAllowedUsergroups has an empty check just before it is used.

So it looks like it was just bakeQuattroParams & bakeRedactorParams functions :)

Xon commented 9 years ago

:+1: