• Register
    • Help

    striker  0 Items
    Currently Supporting
    • Home
    • News
    • Forum
    • Wiki
    • Support
      • Manage Subscriptions
      • FAQ
      • Support For
        • VaultWiki 4.x Series
        • VaultWiki.org Site
    • What's New?
    • Buy Now
    • Manual
    • 
    • Support
    • VaultWiki 4.x Series
    • Bug
    • Server Error

    1. Welcome to VaultWiki.org, home of the wiki add-on for vBulletin and XenForo!

      VaultWiki allows your existing forum users to collaborate on creating and managing a site's content pages. VaultWiki is a fully-featured and fully-supported wiki solution for vBulletin and XenForo.

      The VaultWiki Team encourages you to join our community of forum administrators and check out VaultWiki for yourself.

    Issue: Server Error

    • Issue Tools
      • View Changes
    1. issueid=3618 March 18, 2014 2:16 PM
      DirtRider DirtRider is offline
      Junior Member
      Server Error
      Server Error

      We keep getting this server error on my setup, I have disabled the WiKi for now as this seems to be slowing down my forum overall

      Code:
      mod_fcgid: stderr: PHP Warning: Missing argument 3 for vw_XenForo_CodeEventListener_Public::controller_pre_dispatch() in /var/www/vhosts/triumphtalk.com/httpdocs/library/vw/XenForo/CodeEventListener/Public.php on line 152
    Issue Details
    Issue Number 3618
    Issue Type Bug
    Project VaultWiki 4.x Series
    Category General
    Status Forum Bug
    Priority 4 - Warnings / Script Errors
    Affected Version 4.0.0 Gamma 4
    Fixed Version (none)
    Milestone VaultWiki 4 Gamma X
    Software DependencyXenForo 1.x
    License TypePaid
    Users able to reproduce bug 0
    Users unable to reproduce bug 0
    Attachments 0
    Assigned Users (none)
    Tags Server Error




    1. March 18, 2014 4:50 PM
      pegasus pegasus is offline
      VaultWiki Team
      XenForo has always sent 3 arguments to controller_pre_dispatch at least since XenForo 1.2, which is the earliest version of XenForo we support. This is the relevant line in library/XenForo/Controller.php:
      Code:
      XenForo_CodeEvent::fire('controller_pre_dispatch', array($this, $action, $controllerName), $controllerName);
      The array there defines the 3 arguments $this, $action, and $controllerName. Sorry but this is not a VaultWiki bug. If $controllerName is not being sent to VaultWiki then some other code on your site is firing controller_pre_dispatch, and it's not following the same callback signature.
      Reply Reply  
    2. March 24, 2014 7:30 AM
      DirtRider DirtRider is offline
      Junior Member
      The error is still coming up with the new patch and unfortunately you're incorrect on this..

      For listeners, controller_pre_dispatch uses 2 arguments...




      It has been 2 arguments since at least 1.1.5.

      If you were constructing your own pre_dispatch function, then it would be 3 arguments. But you're listening for pre_dispatch, so it's 2.
      Reply Reply  
    3. March 24, 2014 3:25 PM
      pegasus pegasus is offline
      VaultWiki Team
      The docs have not been updated since 1.1.5, but I quoted the line from the XenForo source code above that shows $controllerName being passed as argument 3. If you can quote me the line where XenForo source code fires controller_pre_dispatch and it doesn't look like what I posted above, then I will happily look into this.

      But I am not receiving such an error on default XenForo either on any pages or in any logs, which leads me to believe you have another mod that fires controller_pre_dispatch in a different way. If you can isolate the mod, please let me know which one.
      Reply Reply  
    4. March 25, 2014 2:36 AM
      DirtRider DirtRider is offline
      Junior Member
      Since the first screenshot of the listener in the developer's interface, which is where it tells you how many arguments are passed and what they are didn't convince you..



      Let's see if this one does.

      This is a screenshot of the XenForo_Controller_preDispatch function..



      How many arguments is it asking for? Three or two?

      Now here's a screenshot of your code...



      How many arguments are you asking for? Hmm.. one too many.

      The listener only passes 2 arguments, not three. Hence why the error (OK warning) 'Missing argument 3'.
      Reply Reply  
    5. March 28, 2014 4:58 AM
      DirtRider DirtRider is offline
      Junior Member
      Is there any solution to this as yet as I am still waiting to upgrade my WiKi
      Reply Reply  
    6. March 28, 2014 10:06 AM
      pegasus pegasus is offline
      VaultWiki Team
      You posted a screenshot above of:
      Code:
      final public function preDispatch($action, $controllName)
      This is not named controller_pre_dispatch nor does it follow the callback signature you highlighted of:
      Code:
      XenForo_Controller $controller, $action
      The bit of code that actually fires controller_pre_dispatch, which I already posted above, is as follows:
      Code:
      XenForo_CodeEvent::fire('controller_pre_dispatch', array($this, $action, $controllerName), $controllerName);
      Aside from this line, there is no DEFINITION in XenForo's source code about controller_pre_dispatch or its parameters. I guess I have to break this down, since you didn't see the callback signature when I posted it the first time.
      XenForo_CodeEvent::fire will execute the set of listeners that is subscribed to a particular event. The event name is 'controller_pre_dispatch' and that is the one we are talking about. XenForo_CodeEvent::fire, if you delve into the source code, is essentially a wrapper function for PHP's own call_user_func_array, which takes an array and passes the contents of it as arguments to the specified function.

      So in XenForo_CodeEvent::fire, it finds our function vw_XenForo_CodeEventListener_Public::controller_pre_dispa tch, and sends the following arguments to it (this is snipped directly from the line I quoted in this post and several posts ago):
      Code:
      array($this, $action, $controllerName)
      Now this is the actual source code, and I don't know about you, but I count 3 items there. None are missing.

      Now that you know where to look, I can tell you that there is a way that this error can occur. However, it is not so simple as being a result of XenForo's ControllerPublic and VaultWiki together. In order to receive the error you are seeing in your logs, the call to XenForo_CodeEvent::fire must look like this:
      Code:
      XenForo_CodeEvent::fire('controller_pre_dispatch', array($this, $action));
      Again, this is because this is the line that ACTUALLY calls the plugin that is reporting the error.

      Now I don't see this variation of the line in my installation, but you obviously have it, or something very similar to it, or you would not be getting the error. In order to help, I need the list of filenames on your site that contain this snippet, so that I can investigate further. You may have better luck simply looking for:
      Code:
      XenForo_CodeEvent::fire('controller_pre_dispatch'
      This will actually return results that send 3 arguments or 2 arguments or no arguments, so please make sure to report ALL the results of your search.
      Reply Reply  
    7. March 28, 2014 12:34 PM
      DirtRider DirtRider is offline
      Junior Member
      Ok, one of my screenshots was a mistake.

      I'm tired of arguing. The first screenshot of the developer interface tells you how many arguments are passed. period. Why you can't see that, I don't know.

      Since it's only called by XF, it only receives two arguments and I'll just remove the un-needed 3rd argument when the time comes.

      Your function should look like this...

      Code:
      public static function controller_pre_dispatch($controller, $action)
      Not like this..

      Code:
      public static function controller_pre_dispatch($controller, $action, $controllerName)
      FYI... this comes straight from a well known coder for XF mods.
      Reply Reply  
    8. April 1, 2014 6:06 PM
      pegasus pegasus is offline
      VaultWiki Team
      I've posted this as a bug for the XenForo devs to review. Whether or not VaultWiki has an error here, there is a discrepancy between XenForo's help text which you quoted and the actual source code that executes it. Whichever way the XenForo devs rule to fix the discrepancy, we will abide by their decision. See: http://xenforo.com/community/threads...istency.71580/
      Reply Reply  
    9. April 2, 2014 9:40 AM
      pegasus pegasus is offline
      VaultWiki Team
      The XenForo devs have responded, so I'm updating the status of this issue to "Forum Bug". According to them, the docs for controller_pre_dispatch were incorrect. It is supposed to say that there are 3 arguments, because there are.

      According to them, it is not possible to get "Missing argument 3" with any listeners (even VaultWiki), because the 3rd argument does exist in the main XenForo code. As I mentioned above, if you are getting a "Missing argument 3", then you have an add-on installed that has this line in its own code:
      Code:
      XenForo_CodeEvent::fire('controller_pre_dispatch', array($this, $action));
      Which needs to be replaced with:
      Code:
      XenForo_CodeEvent::fire('controller_pre_dispatch', array($this, $action, $controllerName), $controllerName);
      You need to identify the add-on that has this code (it's not VaultWiki), and contact the author to alert them that the line does not match.
      Reply Reply  
    10. April 3, 2014 2:39 PM
      DirtRider DirtRider is offline
      Junior Member
      I think I will just accept this as being a bust and remove the WiKi
      Reply Reply  
    + Reply

    Assigned Users
    Loading Please Wait
    Tags
    Loading Please Wait
    • Contact Us
    • License Agreement
    • Privacy
    • Terms
    • Top
    All times are GMT -4. The time now is 7:21 AM.
    This site uses cookies to help personalize content, to tailor your experience, and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Learn more… Accept Remind me later
  • striker
    Powered by vBulletin® Version 4.2.5 Beta 2
    Copyright © 2025 vBulletin Solutions Inc. All rights reserved.
    Search Engine Optimisation provided by DragonByte SEO (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
    Copyright © 2008 - 2024 VaultWiki Team, Cracked Egg Studios, LLC.