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

[5.x]: TypeError on generating catalog pricing when condition select is empty #3591

Closed
white-lukas opened this issue Jul 18, 2024 · 3 comments

Comments

@white-lukas
Copy link

What happened?

Description

When creating a pricing rule with a purchasableCondition but leaving the select empty, you are able to save the pricing rule, but the generation of the catalog pricing will fall.

So or the saving of the pricing rule should fail when it's empty, or the value should fallback to an empty array.

In combination with plugins that are creating other purchaseble type's it's now impossible to create a pricing rule for a specific variant

verbb/gift-voucher#129

Steps to reproduce

  1. Create a pricing rule
  2. Select purchaseble condition
  3. Leave select empty

Expected behavior

Saving would fail with a validation error or select would fallback to an empty array

Actual behavior

Generation of catalog pricing fails

Craft CMS version

5.2.7

Craft Commerce version

5.0.12.2

PHP version

8.3

Operating system and version

No response

Database type and version

No response

Image driver and version

No response

Installed plugins and versions

  • verb/gift-voucher
Copy link

linear bot commented Jul 18, 2024

@nfourtythree nfourtythree self-assigned this Jul 19, 2024
nfourtythree added a commit that referenced this issue Jul 19, 2024
…n-generating-catalog-pricing-when-condition

Fixed #3591 purchasable condition rule empty values
@nfourtythree
Copy link
Contributor

Hi @white-lukas

Thank you for reporting, we were able to replicate the issue and have pushed up a fix which will be included in the next release of Commerce.

To get this early, change your craftcms/commerce requirement in your project's composer.json to:

"require": {
  "craftcms/commerce": "5.x-dev#2bd64462cc60f7bb238bafcac4021bf0d42afa73 as 5.0.13",
  "...": "..."
}

Then run composer update.

Thanks!

@nfourtythree
Copy link
Contributor

Hi

Commerce 5.0.14 has now been released with this fix included.

Please update your project to get the latest version.

Thanks!

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

No branches or pull requests

2 participants