Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid text representation when trying to restore deleted product #867

Open
Tam opened this issue May 15, 2019 · 0 comments

Comments

Projects
None yet
2 participants
@Tam
Copy link

commented May 15, 2019

Description

I get the following SQL error when trying to restore a deleted product:

SQLSTATE[22P02]: Invalid text representation: 7 ERROR:  invalid input syntax for integer: "t"
The SQL being executed was: 
SELECT "elements"."id", "elements"."fieldLayoutId", "elements"."uid", "elements"."enabled", "elements"."archived", "elements"."dateCreated", "elements"."dateUpdated", "elements_sites"."slug", "elements_sites"."uri", "elements_sites"."enabled" AS "enabledForSite", "elements"."dateDeleted", "commerce_variants"."id", "commerce_variants"."productId", "commerce_variants"."isDefault", "commerce_variants"."sku", "commerce_variants"."price", "commerce_variants"."sortOrder", "commerce_variants"."width", "commerce_variants"."height", "commerce_variants"."length", "commerce_variants"."weight", "commerce_variants"."stock", "commerce_variants"."hasUnlimitedStock", "commerce_variants"."minQty", "commerce_variants"."maxQty", "content"."id" AS "contentId", "content"."title"FROM (SELECT "elements"."id" AS "elementsId", "elements_sites"."id" AS "elementsSitesId", "content"."id" AS "contentId"FROM "elements" "elements"INNER JOIN "commerce_variants" "commerce_variants" ON "commerce_variants"."id" = "elements"."id"LEFT JOIN "commerce_products" "commerce_products" ON "commerce_variants"."productId" = "commerce_products"."id"INNER JOIN "elements_sites" "elements_sites" ON "elements_sites"."elementId" = "elements"."id"INNER JOIN "content" "content" ON "content"."elementId" = "elements"."id"WHERE ("commerce_variants"."productId"=24) AND ("elements_sites"."siteId"=1) AND ("commerce_variants"."deletedWithProduct"=TRUE) AND ("content"."siteId"=1) AND ("elements"."archived"=FALSE) AND (NOT ("elements"."dateDeleted" IS NULL))ORDER BY "commerce_variants"."sortOrder") "subquery"INNER JOIN "commerce_variants" "commerce_variants" ON "commerce_variants"."id" = "subquery"."elementsId"INNER JOIN "elements" "elements" ON "elements"."id" = "subquery"."elementsId"INNER JOIN "elements_sites" "elements_sites" ON "elements_sites"."id" = "subquery"."elementsSitesId"INNER JOIN "content" "content" ON "content"."id" = "subquery"."contentId"ORDER BY "commerce_variants"."sortOrder"

Steps to reproduce

  1. Delete a product
  2. Try to restore it

Additional info

  • Craft version: Craft Pro 3.1.26
  • PHP version: 7.3.4
  • Database driver & version: PostgreSQL 11.2
  • Plugins & versions: Craft Commerce 2.1.5.2

@lukeholder lukeholder added the bug label May 15, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.