What's new
Xen Factory

Register today to become a member! Once signed in, you'll be able to start purchasing our products, ask questions, request support and suggest new ideas!

  • This area is dedicated to the support of our xF1 add-ons. For xF2, please use the dedicated area: HERE.
  • We are aware that a no permission error was shown when you tried to purchase in the last 2 days, this is now fixed.

Bug Fixed Incompatibility with another add-on

Freelancer

Member
I installed "Advanced Rules" from PIX-House and whenever I use that to have a Rule as interstitial before a user can view a Thread, the following errors are thrown. (By the way: the forum has "allow sales" not active – sales are not activated)...

Code:
Error Info
Undefined index: forum - library/XFA/ForumSales/Extends/ControllerPublic/Thread.php:19

Stack Trace
#0 /var/www/clients/client180/web812/web/library/XFA/ForumSales/Extends/ControllerPublic/Thread.php(19): XenForo_Application::handlePhpError(8, 'Undefined index...', '/var/www/client...', 19, Array)
#1 /var/www/clients/client180/web812/web/library/SV/ModEss/XenForo/ControllerPublic/Thread.php(17): XFA_ForumSales_Extends_ControllerPublic_Thread->actionIndex()
#2 /var/www/clients/client180/web812/web/library/XenForo/FrontController.php(351): SV_ModEss_XenForo_ControllerPublic_Thread->actionIndex()
#3 /var/www/clients/client180/web812/web/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#4 /var/www/clients/client180/web812/web/index.php(13): XenForo_FrontController->run()
#5 {main}

Request State
Array
(
    [url] => https://www.mywebsite.com/threads/guests-online.1009/
    [_GET] => Array
        (
            [/threads/guests-online_1009/] => 
        )

    [_POST] => Array
        (
        )

)

Code:
Error Info
Argument 2 passed to XFA_ForumSales_Extends_Model_Thread::canManageSale() must be of the type array, null given, called in /var/www/clients/client180/web812/web/library/XFA/ForumSales/Extends/ControllerPublic/Thread.php on line 19 - library/XFA/ForumSales/Extends/Model/Thread.php:19

Stack Trace
#0 /var/www/clients/client180/web812/web/library/XFA/ForumSales/Extends/ControllerPublic/Thread.php(19): XFA_ForumSales_Extends_Model_Thread->canManageSale(Array, NULL)
#1 /var/www/clients/client180/web812/web/library/SV/ModEss/XenForo/ControllerPublic/Thread.php(17): XFA_ForumSales_Extends_ControllerPublic_Thread->actionIndex()
#2 /var/www/clients/client180/web812/web/library/XenForo/FrontController.php(351): SV_ModEss_XenForo_ControllerPublic_Thread->actionIndex()
#3 /var/www/clients/client180/web812/web/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#4 /var/www/clients/client180/web812/web/index.php(13): XenForo_FrontController->run()
#5 {main}

Request State
Array
(
    [url] => https://www.mywebsite.com/threads/guests-online.1009/
    [_GET] => Array
        (
            [/threads/guests-online_1009/] => 
        )

    [_POST] => Array
        (
        )

)


Maybe you have a clue/hint where this error originates from...

(You see "ModEss" there above, but the Forum Sales error keeps coming even if I deactivate ModEss add-on, as long as "Advanced Rules" is active...)
 
No, the access (permissions) is not limited. It is just a forum where "allow sales" is not selected.

But the "Advanced Rules" add-on puts an interstitial rule page before you can read a thread. Only if you accept the rule you can read the thread.
 
Ah then that may be the reason.

But in that case it's not normal that the corresponding add-on doesn't provide the same exact data than the default actionIndex if it doesn't output an error. It means that they change the behavior of the default code for other add-ons to run. Not a good thing.

You should warn the add-on author of that as it does lead to incompatibilities.
I for sure can't handle the case of every add-on that would change the normal behavior of xf...
 
Thanks for the hint. Can you elaborate a little bit more what I should say the add-on author? As far as I understand you he changed the XF default code bahavior to something odd/custom and that's bringing the incompatibilities. What alternative route would you suggest?
 
@MtoR

We were able to get rid of the Error by tweaking FORUM SALES...
/library/XFA/ForumSales/Extends/ControllerPublic/Thread.php

It was
PHP:
if (isset($response->params['thread']))
        {
            $response->params['canSell'] = $this->_getThreadModel()->canManageSale($response->params['thread'], $response->params['forum']);

We changed it to
PHP:
if (isset($response->params['thread']) && isset($response->params['forum']))
        {
            $response->params['canSell'] = $this->_getThreadModel()->canManageSale($response->params['thread'], $response->params['forum']);

Could you change this in the next update?
 
Last edited:
Hello,

I could for sure but it's not normal to have to do that.

I am extending the actionIndex for the thread public controller.
This controller returns both forum and thread as variable of the view.

If the view doesn't return that anymore due to the other add-on it's abnormal.

But well I'll add it but I am not very happy with that...

Clément
 
Top