sheevazz / searchable-behaviour-for-cakephp

Automatically exported from code.google.com/p/searchable-behaviour-for-cakephp
0 stars 0 forks source link

Wrong SQL script generated when primaryKey is not 'id' #4

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
If you defined other primaryKey instead of cake's default "id",
the SQL script will be wrong.

So I replaced search_index.php(line 35) with 

$models_condition[] = $model . '.id IS NOT NULL'; 
 ->
$models_condition[] = $model . '.' . $this->$model->primaryKey . ' IS NOT
NULL';

I'm using cakephp 1.2 rc3.

Original issue reported on code.google.com by citys...@gmail.com on 14 Oct 2008 at 8:47

GoogleCodeExporter commented 9 years ago
what is search_index.php? the code here is called searchable.php. Is this 
really to do with this behaviour?

Original comment by jamierm...@gmail.com on 14 Oct 2008 at 8:58

GoogleCodeExporter commented 9 years ago
Sorry, I forget to give the filename.
The following is the extracted archive file. What I mentioned is 
search_index.php in
models/. It is an example for writing the SearchIndex model, right?

└─searchable-behaviour
    └─models
        │  search_index.php
        │
        └─behaviors
                searchable.php

Original comment by citys...@gmail.com on 14 Oct 2008 at 9:08

GoogleCodeExporter commented 9 years ago
Whoops! I forgot about that file as it's not in the repository!

Original comment by jamierm...@gmail.com on 14 Oct 2008 at 9:15

GoogleCodeExporter commented 9 years ago

Original comment by calin....@gmail.com on 10 Jun 2009 at 10:55