CakePHP select no longer executes after upgrade to 4.1

39 views Asked by At

A query that has been running for years in CakePHP 3.X no longer executes after upgrading to CakePHP 4.1. The $order array contains correct values and the SQL query looks good and identical to the CakePHP 3.X version. All other queries in the upgraded app run fine.

Can anybody help me in understanding? Thanks in advance.

public function getQuotes($order)
{
    $quotes = TableRegistry::get('Quotes');
    $query = $quotes->find('all', array(
        'contain' => array('Exchanges'),
        'order' => array('type','strike'),
        'conditions' => array('AND' => array(
            'expiry' => $order[0]['expiry'],
            'type' => $order[0]['callType'],
            'exchange_id' => $order[0]['exchange_id'],
            'strike' => $order[0]['callStrike']
        ))
    ));

    $result = $query->toArray();
    Log::write('error', print_r($result,true));

    return $result;
}
1

There are 1 answers

0
Andre Hartman On

Problem solved; it was something else all together plus a very confusing error message.