⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

Possible bug when quick filtering integer fields



cletourneau

cletourneau
  • profile picture
  • Member

Posted 29 June 2018 - 03:23 AM

grocery-crud-enterprise version : 2.5.7

php version : 5.6

database : postgres 9.6

 

When trying to quick filter integer columns, I get this error

Message: pg_query(): Query failed: ERROR: operator does not exist: integer ~~ unknown LINE 1: ...ompanies" WHERE ipsum_finance_companies.id_acomba LIKE '%35%... ^ HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.

The problems seems to have its source from Grocery-Crud-Enterprise Model.php. All columns seems to be considered as varchar (no matter the column type)

See Model.php _setWhereArray

 

Hope you can fix!

 

 

 


larasmith

larasmith
  • profile picture
  • Member

Posted 29 June 2018 - 05:07 AM

Could you show your table structure?

 

Mine is working properly...


cletourneau

cletourneau
  • profile picture
  • Member

Posted 29 June 2018 - 13:37 PM

CREATE TABLE public.finance_companies
(
    id_acomba INT PRIMARY KEY,
    no_accreditation INT,
    nom_entreprise VARCHAR(255),
    no_rbq VARCHAR(10),
    adresse VARCHAR(255),
    ville VARCHAR(255),
    code_postal VARCHAR(7)
);

Quick search won't work for all INT columns.

 

Keep in mind my database is Postgres, and I'm using the latest GCE.


larasmith

larasmith
  • profile picture
  • Member

Posted 30 June 2018 - 03:33 AM

Oh sorry I am not using Postgres as database...