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

Error when a loaded Condition does not specify an element type #329

Open
elivz opened this issue Aug 30, 2024 · 2 comments
Open

Error when a loaded Condition does not specify an element type #329

elivz opened this issue Aug 30, 2024 · 2 comments
Labels

Comments

@elivz
Copy link

elivz commented Aug 30, 2024

Description

I ran into this issue when running Sprout Data Studio and Craft Commerce, but I don't believe it is specific to Commerce. An element condition is not required to specify an element type (using getElementType(), but the logic in your ConditionalHelper class assumes that that attribute will always be present.

A simple fix for this is to change line 13 of that file to:

$elementType = $event->sender?->elementType ?? null;

How to reproduce

Install Data Studio alongside Craft Commerce. Visit any Order detail page. You should receive error:

Getting unknown property: craft\commerce\elements\conditions\purchasables\CatalogPricingCondition::elementType

Sprout Version

5.0.1

Craft Version

5.3.6

Database Type Version

MySQL 8

@elivz elivz added the bug label Aug 30, 2024
@anthonyjharrison
Copy link

Adding another voice to this issue. It also impacts the front end website when querying and displaying products. Thank you @elivz for the workaround but hoping @BenParizek can roll out a core fix ASAP??

@LeonBatch
Copy link

Pretty please 😄 @BenParizek

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants