Bagisto Forum

    Bagisto

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

    Unknown column when using filter on Datagrid

    Bug Report
    2
    2
    142
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      sfarzoso last edited by

      I'm trying to add custom filter on the DataGrid, but for some reason I get each time "unknown column", this is the full class:

      https://pastebin.com/nfc9ywZk

      so if I select this filter:

      created at -> greather than -> 01/01/2023 and press apply, I get:

      SQLSTATE[42S22]: Column not found: 1054 Unknown column '' in 'where clause' (SQL: select count(*) as aggregate from configurations left join bikes as bike on bike.id = configurations.bike_id where `` = 2023-01-01)

      seems like the column name is in some way lost

      1 Reply Last reply Reply Quote 0
      • A
        Amitk-Webkul last edited by

        Hi there,

        Please use a filter like this to implement Filter functionality.

        Path- https://github.com/bagisto/bagisto/blob/v1.5.1/packages/Webkul/Admin/src/DataGrids/ProductDataGrid.php#L125

        1 Reply Last reply Reply Quote 0
        • First post
          Last post