Skip to content

Cannot attach collection from product detail (Postgres Issue) #2261

@kresnasatya

Description

@kresnasatya
  • Lunar version: 1.0.0-beta25
  • Laravel Version: 12.21.0
  • PHP Version: 8.3.24
  • Database Driver & Version: Postgresql v 16.2

Expected Behaviour:

Each time I add a collection from a product detail, I get an error like this:

Undefined function: 7 ERROR:  could not identify an equality operator for type json
LINE 1: select distinct "lunar_collections".*, "lunar_collection_pro...
                        ^ (Connection: pgsql, SQL: select distinct "lunar_collections".*, "lunar_collection_product"."position" from "lunar_collections" left join "lunar_collection_product" on "lunar_collections"."id" = "lunar_collection_product"."collection_id" where "lunar_collections"."id" = 1 order by "lunar_collection_product"."position" asc limit 1)

SQLSTATE[42883]: Undefined function: 7 ERROR:  could not identify an equality operator for type json

I think the culprit is come the attribute_data column in lunar_collections table. I actually want to try to repair but I'm clueless with Filament. I can spot the source come from this file: https://github.com/lunarphp/lunar/blob/1.x/packages/admin/src/Filament/Resources/ProductResource/Pages/ManageProductCollections.php#L62

Actual Behaviour:

I can search the collection from product detail and add the collection into the product detail smoothly.

Steps To Reproduce:

  1. Go to product detail
  2. Go to collections
  3. Create attach
  4. Search collection then attach and you will see the error
Screen.Recording.2025-08-02.at.11.44.34.mov

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions