{"action":"closed","issue":{"url":"https://api.github.com/repos/verbb/feed-me/issues/396","repository_url":"https://api.github.com/repos/verbb/feed-me","labels_url":"https://api.github.com/repos/verbb/feed-me/issues/396/labels{/name}","comments_url":"https://api.github.com/repos/verbb/feed-me/issues/396/comments","events_url":"https://api.github.com/repos/verbb/feed-me/issues/396/events","html_url":"https://github.com/verbb/feed-me/issues/396","id":362305602,"node_id":"MDU6SXNzdWUzNjIzMDU2MDI=","number":396,"title":"PostgreSQL compatibility for importing Commerce Products with unique field = variant sku","user":{"login":"boboldehampsink","id":378974,"node_id":"MDQ6VXNlcjM3ODk3NA==","avatar_url":"https://avatars3.githubusercontent.com/u/378974?v=4","gravatar_id":"","url":"https://api.github.com/users/boboldehampsink","html_url":"https://github.com/boboldehampsink","followers_url":"https://api.github.com/users/boboldehampsink/followers","following_url":"https://api.github.com/users/boboldehampsink/following{/other_user}","gists_url":"https://api.github.com/users/boboldehampsink/gists{/gist_id}","starred_url":"https://api.github.com/users/boboldehampsink/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/boboldehampsink/subscriptions","organizations_url":"https://api.github.com/users/boboldehampsink/orgs","repos_url":"https://api.github.com/users/boboldehampsink/repos","events_url":"https://api.github.com/users/boboldehampsink/events{/privacy}","received_events_url":"https://api.github.com/users/boboldehampsink/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-09-20T18:19:16Z","updated_at":"2018-10-23T06:18:11Z","closed_at":"2018-10-23T06:18:11Z","author_association":"NONE","body":"### Description\r\n\r\nImporting Commerce Products with unique field = variant SKU fails on PostgreSQL with the error: \r\n\r\n```sql\r\nERROR: invalid input syntax for integer: \"placeholder\" 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\", \"commerce_products\".\"id\", \"commerce_products\".\"typeId\", \"commerce_products\".\"promotable\", \"commerce_products\".\"freeShipping\", \"commerce_products\".\"postDate\", \"commerce_products\".\"expiryDate\", \"commerce_products\".\"defaultPrice\", \"commerce_products\".\"defaultVariantId\", \"commerce_products\".\"defaultSku\", \"commerce_products\".\"defaultWeight\", \"commerce_products\".\"defaultLength\", \"commerce_products\".\"defaultWidth\", \"commerce_products\".\"defaultHeight\", \"commerce_products\".\"taxCategoryId\", \"commerce_products\".\"shippingCategoryId\", \"commerce_products\".\"availableForPurchase\", \"content\"[...] FROM (SELECT \"elements\".\"id\" AS \"elementsId\", \"elements_sites\".\"id\" AS \"elementsSitesId\", \"content\".\"id\" AS \"contentId\" FROM \"elements\" \"elements\" INNER JOIN \"commerce_products\" \"commerce_products\" ON \"commerce_products\".\"id\" = \"elements\".\"id\" INNER JOIN \"elements_sites\" \"elements_sites\" ON \"elements_sites\".\"elementId\" = \"elements\".\"id\" INNER JOIN \"content\" \"content\" ON \"content\".\"elementId\" = \"elements\".\"id\" WHERE (\"commerce_products\".\"typeId\"='3') AND (\"elements_sites\".\"siteId\"='2') AND (\"content\".\"siteId\"='2') AND (\"elements\".\"id\"='placeholder') AND (\"elements\".\"archived\"=FALSE) ORDER BY \"commerce_products\".\"postDate\" DESC LIMIT 1) \"subquery\" INNER JOIN \"commerce_products\" \"commerce_products\" ON \"commerce_products\".\"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_products\".\"postDate\" DESC - Schema.php:664\r\n```\r\n\r\nThis is because you query elements.id with the string \"placeholder\", which is not valid. This should be an int. See https://github.com/verbb/feed-me/blob/9261a9b18e0a6eab5c2e94d0737dcdacb603fabc/src/elements/CommerceProduct.php#L201\r\n\r\n### Steps to reproduce\r\n\r\n1. Run import with PostgreSQL\r\n2. Import Commerce Products\r\n3. Use Variant SKU as unique field\r\n\r\n### Additional info\r\n\r\n- Plugin version: latest\r\n- Craft version: latest"}}
{"actor":{"display_login":"engram-design"}}