Comments (8)
@AugustMiller Ahh yes - I think this is due to Commerce changing the way plans are referenced (https://github.com/craftcms/commerce/blob/develop/CHANGELOG-v2.md#security) I'll push a fix for this tomorrow.
from craft-commerce-widgets.
@AugustMiller I think hiding widgets that don't apply is a good idea! I'll be pushing a fix for this later this week :)
from craft-commerce-widgets.
@AugustMiller I can't seem to replicate this issue. I've hit you up on Slack but doesn't look like you've been on. If you can jump on there or post more details in here we can solve this 💪
from craft-commerce-widgets.
This is embarrassing—I think I'd only tried this on a site without any subscriptions configured?
Unfortunately, I can't get a test subscription set up at the moment, but I'm curious to know whether emptying your available Subscriptions produces the same error?
Edit: Probably worth investigating for the ding-dongs like me who click around hastily, and might inadvertently take down their dashboard 😉 (Or maybe hiding the widgets that don't apply to the apps where it's installed?)
from craft-commerce-widgets.
FYI—tried a few more widgets, and even relevant ones seem to generate SQL errors.
It seems most errors are just mismatched column names, or potentially issues with case-sensitivity?
For context, this app uses Postgres—apologies for not mentioning this in the original issue!
from craft-commerce-widgets.
@AugustMiller I'll run tests using a Postgres database then - But could you paste some of the errors your getting in to this issue?
from craft-commerce-widgets.
So sorry this has dragged on! 😥
Got a couple messages for you—overall, it seems like the case sensitivity in Postgres is responsible for most of these?
bymayo\commercewidgets\widgets\ProductsTop::getProducts()
SQLSTATE[42703]: Undefined column: 7 ERROR: column items.purchasableid does not exist
LINE 3: ...purchasables" "purchasables" ON purchasables.id = items.purc...
^
HINT: Perhaps you meant to reference the column "items.purchasableId".
The SQL being executed was: SELECT "variants"."productId" AS "id", "variants"."sku" AS "sku", SUM(items.total) as totalRevenue, count(*) as totalOrdered
FROM "commerce_lineitems" "items"
LEFT JOIN "commerce_purchasables" "purchasables" ON purchasables.id = items.purchasableId
LEFT JOIN "commerce_variants" "variants" ON variants.id = purchasables.id
GROUP BY "items"."purchasableId"
ORDER BY "totalRevenue" DESC
LIMIT 5
bymayo\commercewidgets\widgets\TotalRevenueOrders::getRevenueOrdersRow(['label' => 'Today', 'date' => '03 Dec 2018'])
SQLSTATE[42703]: Undefined column: 7 ERROR: column orders.totalprice does not exist
LINE 1: SELECT COALESCE(sum(orders.totalPrice), 0) as totalRevenue, ...
^
HINT: Perhaps you meant to reference the column "orders.totalPrice".
The SQL being executed was: SELECT COALESCE(sum(orders.totalPrice), 0) as totalRevenue, COALESCE(count(orders.id), 0) as totalOrders
FROM "commerce_orders" "orders"
WHERE ("orders"."isCompleted"=1) AND (DATE_FORMAT(orders.dateCreated, "%Y-%m-%d")='2018-12-07')
LIMIT 1
bymayo\commercewidgets\widgets\TopCustomers::getCustomers()
SQLSTATE[42703]: Undefined column: 7 ERROR: column orders.totalprice does not exist
LINE 1: SELECT count(*) as totalOrders, SUM(orders.totalPrice) as to...
^
HINT: Perhaps you meant to reference the column "orders.totalPrice".
The SQL being executed was: SELECT count(*) as totalOrders, SUM(orders.totalPrice) as totalRevenue, "orders"."email", "orders"."customerId"
FROM "commerce_orders" "orders"
WHERE "orders"."isCompleted"=1
GROUP BY "orders"."email"
ORDER BY "totalOrders" DESC
LIMIT 5
bymayo\commercewidgets\widgets\Goal::getTotals()
SQLSTATE[42703]: Undefined column: 7 ERROR: column orders.totalpaid does not exist
LINE 1: ...OALESCE(count(*), 0) as totalOrders, COALESCE(SUM(orders.tot...
^
HINT: Perhaps you meant to reference the column "orders.totalPaid".
The SQL being executed was: SELECT COALESCE(count(*), 0) as totalOrders, COALESCE(SUM(orders.totalPaid),0) as totalRevenue
FROM "commerce_orders" "orders"
WHERE (WEEK(orders.datePaid)='49') AND (YEAR(orders.datePaid)='2018')
LIMIT 1
bymayo\commercewidgets\widgets\SubscriptionPlans::getSubscriptionPlans()
SQLSTATE[42703]: Undefined column: 7 ERROR: column subscriptions.planid does not exist
LINE 3: ... JOIN "commerce_subscriptions" "subscriptions" ON subscripti...
^
HINT: Perhaps you meant to reference the column "subscriptions.planId".
The SQL being executed was: SELECT "plans".*, COUNT(subscriptions.planId) as activeSubscriptions
FROM "commerce_plans" "plans"
LEFT JOIN "commerce_subscriptions" "subscriptions" ON subscriptions.planId = plans.id
WHERE "plans"."isArchived"=0
GROUP BY "plans"."id"
ORDER BY "dateCreated" DESC
LIMIT 4
from craft-commerce-widgets.
@AugustMiller I'm having difficulties fixing this issue, as I've just installed the widgets on a fresh site that only has orders (No subscriptions) and the widgets / CMS doesn't error when enabling subscriptions widgets with no plans available.
Also with the Postgres errors, they do look like case errors, but looking at my queries i'm targeting them with the correct case (Not like it says in the error).
Is there any more information you can give, or if your happy to jump on Slack one day we can bash this error out a bit easier?
from craft-commerce-widgets.
Related Issues (20)
- Cart Abandonment Chart (visual) HOT 4
- Completed carts figure incorrect HOT 2
- Total Ordered value incorrect HOT 6
- Getting a MySQL Error in production environment HOT 2
- Issues with Verbb Gift Voucher HOT 2
- Subscription link doesn't work on 'Subscription Plans'
- Fiscal Year
- Cache Last Updated
- Additional revenue breakdowns
- Trashed orders are being included in all totals HOT 3
- FR: Ability to exclude orders from specific emails HOT 2
- SQL 5.7 error on Top Customers widget HOT 3
- Top Products & Cart Abandonment Graph trashed elements
- Top Customers Error
- Widget timezone reporting HOT 1
- Settings Screen Blank HOT 1
- Calculate revenue from products instead of order
- Craft v4 HOT 3
- PostgreSQL Case Sensitive Issue
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from craft-commerce-widgets.