barrelstrength/sprout-fields

PDOException when setting unique email required on sprout email field

Opened this issue · 0 comments

Description (screenshots, logs, ...)

Hey, I am adding a sprout email field to a matrix and I am getting what looks like a PDO error when required the email address to be unique.
Database Exception – yii\db\Exception SQLSTATE[42601]: Syntax error: 7 ERROR: syntax error at or near ""
LINE 3: ...elements"."id" = "matrixcontent_contactlocations".elementId... ^ The SQL being executed was: SELECT "field_location_locationSecondaryEmail" FROM "matrixcontent_contactlocations" INNER JOIN "elements" "elements" ON "elements"."id" = "matrixcontent_contactlocations".elementId WHERE ("field_location_locationSecondaryEmail"='cgysales@mroelectronics.com') AND ("elements"."draftId" IS NULL) AND ("elements"."revisionId" IS NULL) AND ("elements"."dateDeleted" IS NULL) AND ("elementId"<>21706) LIMIT 1 Error Info: Array ( [0] => 42601 [1] => 7 [2] => ERROR: syntax error at or near ""
LINE 3: ...elements"."id" = "matrixcontent_contactlocations".elementId... ^ ) ↵ Caused by: PDOException SQLSTATE[42601]: Syntax error: 7 ERROR: syntax error at or near ""
LINE 3: ...elements"."id" = "matrixcontent_contactlocations".elementId... ^

Steps to reproduce

  1. Create a matrix field.
  2. Add a sprout email field as matrix block type field with unique address required.
  3. Add matrix to a single
  4. Enter an email into the matrix field from singles entry section
  5. Press save and you get an error.

Additional info

  • Craft version: Craft CMS 3.4.26 (Pro)
  • PHP version: 7.2.24
  • Database driver & version: PostgreSQL 10.12
  • Plugins & versions:
    • Cloner 1.1.2
    • CP Field Inspect 1.1.3
    • Craft Commerce 3.1.10
    • Default Dashboard 1.0.8
    • Elements Panel 1.1.0
    • Feed Me 4.2.3
    • Field Manager 2.1.6
    • Forms 3.7.0
    • Google Cloud Storage 1.4.0
    • ImageOptimize 1.6.14
    • Incognito Field 1.1.1.1
    • Navigation 1.3.21
    • Redactor 2.6.1
    • SEO 3.3.8
    • Sprout Fields 3.8.3
    • Super Table 2.5.1
    • Typed link field 1.0.23