Skip to content

problem with GridFieldAddExistingSearchButton and Fluent #356

@RoyalPulp

Description

@RoyalPulp

Hello there :)

I just found the GridFieldAddExistingSearchButton as a useful alternative to the deprecated MultiSelectField for many_many relations.
Unfortunately I don't get the search functionality to work on websites with Fluent Extension (tried it successfully on 2 Projects without multilanguage/Fluent module - but no success with 2 projects that use Fluent Module)

Page <-> many_many <-> SeitenLink Objects

Here the full error message - I hope somebody can interpret it in relation with the module code

The term "LIK" looks a bit strange to me (right at the end of the SQL ).. maybe the string isn't complete??

error-log.ERROR: Uncaught Exception SilverStripe\ORM\Connect\DatabaseException: "Couldn't run query: SELECT CASE WHEN EXISTS SELECT * FROM "SeitenLink" LEFT JOIN "SeitenLink_Localised" AS "SeitenLink_Localised_de_DE" ON "SeitenLink"."ID" = "SeitenLink_Localised_de_DE"."RecordID" AND "SeitenLink_Localised_de_DE"."Locale" = ? WHERE () AND (COALESCE("SeitenLink_Localised_de_DE"."Title", "SeitenLink"."Title") LIKE ?) AND ("SeitenLink"."ID" NOT IN SELECT DISTINCT "SeitenLink"."ID" FROM "SeitenLink" INNER JOIN "Page_SeitenLinks" ON "Page_SeitenLinks"."SeitenLinkID" = "SeitenLink"."ID" LEFT JOIN "SeitenLink_Localised" AS "SeitenLink_Localised_de_DE" ON "SeitenLink"."ID" = "SeitenLink_Localised_de_DE"."RecordID" AND "SeitenLink_Localised_de_DE"."Locale" = ? WHERE ("Page_SeitenLinks"."PageID" = ?)))) THEN 1 ELSE 0 END SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') AND (COALESCE("SeitenLink_Localised_de_DE"."Title", "SeitenLink"."Title") LIK' at line 3" at (...)/vendor/silverstripe/framework/src/ORM/Connect/DBConnector.php line 64 {"exception":"[object] (SilverStripe\\ORM\\Connect\\DatabaseException(code: 0): Couldn't run query:\n\nSELECT CASE WHEN EXISTS\nSELECT *\n\nFROM \"SeitenLink\"\nLEFT JOIN \"SeitenLink_Localised\" AS \"SeitenLink_Localised_de_DE\" ON \"SeitenLink\".\"ID\" = \"SeitenLink_Localised_de_DE\".\"RecordID\" AND \"SeitenLink_Localised_de_DE\".\"Locale\" = ?\n\nWHERE ()\n AND (COALESCE(\"SeitenLink_Localised_de_DE\".\"Title\", \"SeitenLink\".\"Title\") LIKE ?)\n AND (\"SeitenLink\".\"ID\" NOT IN \nSELECT DISTINCT \"SeitenLink\".\"ID\"\n\nFROM \"SeitenLink\"\nINNER JOIN \"Page_SeitenLinks\" ON \"Page_SeitenLinks\".\"SeitenLinkID\" = \"SeitenLink\".\"ID\"\nLEFT JOIN \"SeitenLink_Localised\" AS \"SeitenLink_Localised_de_DE\" ON \"SeitenLink\".\"ID\" = \"SeitenLink_Localised_de_DE\".\"RecordID\" AND \"SeitenLink_Localised_de_DE\".\"Locale\" = ?\n\nWHERE (\"Page_SeitenLinks\".\"PageID\" = ?)))) THEN 1 ELSE 0 END\n\nSQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')\n AND (COALESCE(\"SeitenLink_Localised_de_DE\".\"Title\", \"SeitenLink\".\"Title\") LIK' at line 3 at (...)/vendor/silverstripe/framework/src/ORM/Connect/DBConnector.php:64)"} []
Thank You all!

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions