0
votes

I'm getting the following errors:

Warning (2): array_keys() expects parameter 1 to be array, null given [CORE\Cake\Model\Datasource\DboSource.php, line 2181]

Warning (2): array_filter() expects parameter 1 to be array, null given [CORE\Cake\Model\Datasource\DboSource.php, line 2185]

Warning (2): array_values() expects parameter 1 to be array, null given [CORE\Cake\Model\Datasource\DboSource.php, line 2185]

Warning (2): array_unique() expects parameter 1 to be array, null given [CORE\Cake\Model\Datasource\DboSource.php, line 2264]

Warning (2): array_merge() [function.array-merge]: Argument #2 is not an array [CORE\Cake\Model\Datasource\DboSource.php, line 1524]

When running this:

public function pdf($the_id) {
    $searchs = $this->Order->find('all', array('conditions' => array('Order.id' => $the_id, 'Order.user_id' => $this->userDetails['id'])));
    if(empty($searchs)){
        $this->Session->setFlash('The requested order was not found or is not your order', 'error');
        $this->redirect(array('action' => 'yourorders'));
    }

    $this->set('orderpdf', $searchs);
}

Does anyone know why?

EDIT ---- Here is the model; it's a new model so it's quite small:

class Order extends AppModel {
    public $name = 'Order';
    public $belongsTo = array('User');
    public $hasOne = array('Basket', 'Sage');
}
1
do both $the_id and $this->userDetails['id'] definitely have values? - Ross
yes I have swapped $this->userDetails['id'] for 4 (int) in the find command. I do get the correct data in both circumstances. - Andrew Myers
... all the errors are concerned with variables involving 'fields' - Andrew Myers

1 Answers

1
votes

$this->Order->unBindModel(array('hasOne' => array('Sage'))); worked. The Sage model doesn't have a table to refer to.