Skip to content

Fixed AttributeDecimal could not be converted to float#1243

Merged
royduin merged 5 commits intomasterfrom
bugfix/price-is-not-float
Apr 3, 2026
Merged

Fixed AttributeDecimal could not be converted to float#1243
royduin merged 5 commits intomasterfrom
bugfix/price-is-not-float

Conversation

@indykoning
Copy link
Copy Markdown
Member

This PR fixes AttributeDecimal could not be converted to float

After the addition of the value, label, etc. functions on the attributes, this change here seems to have been forgotten.

This causes errors on the indexers and PDPs when products do not have their price in the product_price index, which seems to be the case when products are out of stock.

@indykoning indykoning requested review from Jade-GG and royduin March 20, 2026 10:32
@Jade-GG
Copy link
Copy Markdown
Collaborator

Jade-GG commented Apr 1, 2026

This vs changing this line to always retrieve the value? Might be cleaner that way? Or maybe that's taking away too much in case you want to use the label instead of the value in an Attribute cast?

@indykoning
Copy link
Copy Markdown
Member Author

Both would absolutely work so it'd be a matter of preference.
I personally prefer it like this to make the code more explicit and easier to understand for newcomers and tooling over extending the magic

@Jade-GG
Copy link
Copy Markdown
Collaborator

Jade-GG commented Apr 3, 2026

Both would absolutely work so it'd be a matter of preference. I personally prefer it like this to make the code more explicit and easier to understand for newcomers and tooling over extending the magic

I agree, it's definitely better to keep things explicit to avoid magic.

My only issue with it would be that it means you don't always know when you have to do ->value without first checking whether you're getting an AbstractAttribute (e.g. name) or a direct column/joined value (e.g. sku). I can see this causing some issues in the future. But we'll have to see.

@royduin royduin merged commit 8b69e3a into master Apr 3, 2026
15 checks passed
@royduin royduin deleted the bugfix/price-is-not-float branch April 3, 2026 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants