1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

array_merge(): Argument #2 is not an array

Discussion in 'XenForo Development Discussions' started by X3nman, Jan 1, 2014.

  1. X3nman

    X3nman Member

    Hi everyone,
    I am trying to fix up an old mod that is now unsupported by the developer.
    I am not a coder and am struggling to understand how to fix a server error it is giving me.
    I have managed to fix other errors through googling and trial and error, but this one is defeating me.
    I don't think it is anything too complicated, but needs someone who knows what they're talking about :D

    Error Info
    ErrorException: array_merge(): Argument #2 is not an array - library/XenAuction/CronEntry/Auction.php:92
    Generated By: User1, A moment ago

    Stack Trace
    #0 [internal function]: XenForo_Application::handlePhpError(2, 'array_merge(): ...', '/home/mysite...', 92, Array)
    #1 /home/mysite.com/library/XenAuction/CronEntry/Auction.php(92): array_merge(Array, false)
    #2 /home/mysite.com/library/XenAuction/ControllerPublic/Process.php(350): XenAuction_CronEntry_Auction::runExpireAuction(Array)
    #3 /home/mysite.com/library/XenForo/FrontController.php(337): XenAuction_ControllerPublic_Process->actionExpire()
    #4 /home/mysite.com/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
    #5 /home/mysite.com/index.php(13): XenForo_FrontController->run()
    #6 {main}

    Request State
    array(3) {
    ["url"] => string(61) "http://mysite.com/index.php?auction-process/expire&id=6"
    ["_GET"] => array(2) {
    ["auction-process/expire"] => string(0) ""
    ["id"] => string(1) "6"
    ["_POST"] => array(0) {

    Lines 91 + 92 in auction.php are as follows....
    // Set phrase params
             $args        = array_merge($auction, $bid);
    I have attached auctions.php for anyone who wants to look at the full file.

    Thanks to anyone who takes a look.

    Attached Files:

  2. Jeremy

    Jeremy Well-Known Member


    You need to verify that XenAuction_Model_Auction::getWinningBid() is returning an array. It would appear it isn't.
  3. altgg

    altgg New Member

    It's bad form, but you can try forcing php to cast the variable as an array by tacking (array) to the front of it. For example:

    $args = array_merge($auction, (array)$bid);

    You might get an error about something else later on, but it also might be just hacky enough to run...

Share This Page